mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2006
Posts: 2
E
Bowl of petunias
OP Offline
Bowl of petunias
E
Joined: Mar 2006
Posts: 2
does anyone have any idea how to get a script to post a msg in a certain channel displaying the name of the poster and the topic of the latest post??
i know its prolly all sockread etc but unfortunatly im not much better then a toddler at it

Joined: Mar 2006
Posts: 395
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
if you own the phpbb board, try and look for an rss mod... it will make your life easier


[02:16] * Titanic has quit IRC (Excess Flood)
Joined: May 2007
Posts: 23
C
Ameglian cow
Offline
Ameglian cow
C
Joined: May 2007
Posts: 23
RSS mod would make life easier but this should work also
Code:
alias checknewtopic {
  sockopen pbcheck $gettok(%pb.site,$iif(http:// isin %pb.site,2,1),47) 80
}

on *:sockopen:pbcheck:{
  sockwrite -n $sockname GET / $+ $gettok(%pb.site,$iif(http:// isin %pb.site,3-,2-),47) HTTP/1.1
  sockwrite -n $sockname Host: $gettok(%pb.site,$iif(http:// isin %pb.site,2,1),47)
  sockwrite -n $sockname Connection: close
  sockwrite $sockname $crlf
  %pb.tr = class="forumlink"> $+ %pb.f $+ <
  unset %pb.ft
}

on *:sockopen:pbtopic:{
  sockwrite -n $sockname GET / $+ $iif(http:// isin %pb.site,$iif($numtok(%pb.site,47) > 3,$gettok(%pb.site,3- $+ $calc($numtok(%pb.site,47)-1),47)),$iif($numtok(%pb.site,47) > 2,$gettok(%pb.site,2- $+ $calc($numtok(%pb.site,47)-1),47))) $+ $chr(47) $+ %pb.ur HTTP/1.1
  sockwrite -n $sockname Host: $gettok(%pb.site,$iif(http:// isin %pb.site,2,1),47)
  sockwrite -n $sockname Connection: close | sockwrite $sockname $crlf | unset %pb.ft2
}

on *:sockread:pbtopic:{
  if (!$sockerr) {
    sockread %pb.t2
    if ($sockbr) {
      if (;highlight= isin %pb.t2) {
        %pb.tn = $mid(%pb.t2,$pos(%pb.t2,;highlight=,1)) | %pb.tn2 = $mid(%pb.tn,$calc($pos(%pb.tn,">) + 2),$calc($pos(%pb.tn,</a) - $pos(%pb.tn,">) - 2))
        echo -s Forum: %pb.f | echo -s Topic: %pb.tn2 | echo -s Author: %pb.at | echo -s Date: %pb.ld
        echo -s URL: $iif(http:// !isin %pb.site,http:// $+ $gettok(%pb.site,1,47),$replace($gettok(%pb.site,1- $+ $calc($numtok(%pb.site,47) -1),47),:/,://)) $+ $chr(47) $+ %pb.ur $+ $chr(35) $+ $gettok(%pb.ur,2,61)
      }
    }
  } 
}

on *:sockread:pbcheck:{
  if (!$sockerr) {
    sockread %pb.t
    if ($sockbr) {
      if (%pb.tr isin %pb.t) { %pb.ft = yes }
      elseif (%pb.ft == yes) {
        if (nowrap isin %pb.t) {
          %pb.sp = $mid(%pb.t,$calc($pos(%pb.t,gensmall,1) + 10))
          %pb.ld = $mid(%pb.sp,0,$calc($pos(%pb.sp,<) - 1))
          %pb.at = $mid(%pb.sp,$calc($pos(%pb.sp,">) + 2),$calc($pos(%pb.sp,</a) - $pos(%pb.sp,">) - 2))
          %pb.ur = $gettok($mid(%pb.sp,$pos(%pb.sp,viewtopic.php?),$calc($pos(%pb.sp,"><) - $pos(%pb.sp,viewtopic.php?))),1,38)
          sockclose pbcheck | sockopen pbtopic $gettok(%pb.site,$iif(http:// isin %pb.site,2,1),47) 80 | unset %pb.ft
        }
      }
    }
  }
}


Just /set %pb.site http://whatever.com/phpbb/index.php to the base Forum Index url. and /set %pb.f to the forum name that you want to display. the /checknewtopic alias will display the following.

forum picked at random from google..

/set %pb.site http://si.planethalflife.gamespy.com/phpbb/index.php

/set %pb.f General

/checknewtopic

will echo the following to status screen

Forum: General
Topic: Play SI!
Author: Q Branch
Date: Tue May 15, 2007 4:17 am
URL: http://si.planethalflife.gamespy.com/phpbb/viewtopic.php?p=102073#102073

it sounded like you know scripting just not good at sockets so i'll let you work out sending it to whatever channel in the format you want instead of echoing to status window.


Link Copied to Clipboard