mIRC Home    About    Download    Register    News    Help

Print Thread
script should work but doesnt #191472 09/12/07 02:35 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
I have a script, which works great, BUT i am using mirc 6.12 for my bot and on this version the script doesnt work. Take alook

Php Code:
on *:text:!rekords &:#:map.show $2
on *:sockopen:map.lv:{
  if $sockerr { echo -aecti info * Socket error $+(",$sockname,":) $sock($sockname).wsmsg | return }
  sockwrite -n $sockname GET /demos/pliks.php HTTP/1.1
  sockwrite -n $sockname Host: trick-jumps.lv
  sockwrite $sockname Connection: Close $+ $str($crlf,2)
}
on *:sockread:map.lv:sockread &a | bwrite map.lv.tmp -1 -1 &a
on *:sockclose:map.lv:if $file(map.lv.tmp) { .remove map.lv | .rename map.lv.tmp map.lv }
alias get.map {
  var %a,%b
  .fopen lv map.lv
  .fseek -w lv $+(*,$$1,*)
  if $ferr || $feof { .fclose lv | return 5,1[0,1 Error: Map $qt($1) not found. 5,1] }
  while *</tr>* !iswm $fread(lv) { var %b = $v2,%a = %a $iif($htmlconv(%b) == Download,$gettok(%b,2,34),$v1) }
  .fclose lv
  if **:** isin %a { return 5,1[0,1 Map $1 dont have record. 5,1] }
  tokenize 32 %a
  return 5,1[0,1 LR: $1 Time: $3 Jumper: $2 Link: $5 5,1]
}
alias -l map.show {
  if !$file(map.lv) || $calc($ctime - $file(map.lv).mtime) > 1800 {
	if !$sock(map.lv) { sockopen map.lv trick-jumps.lv 80 }
  }
  set -e %map.lv. $+ $1 # $1
  if !$timer(map.lv) { .timermap.lv 0 1 map.lv # }
}
alias map.lv {
  if $sock(map.lv) { return }
  if $var(map.lv.*,1).value {
	tokenize 32 $v1
	msg $$1 $get.map($2)
	unset $var(map.lv.*,1)
  }
  else .timermap.lv off
}
alias -l htmlconv return $remove($regsubex($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,),&,$chr(9))
 


Well what it should do is connect to web, save the file, and show result in channel. And it does connect to web and save file correctly, but it doesnt show result in channel. Maybe someone could edit it so it works on mIRC 6.12? Can't change version now frown

Re: script should work but doesnt [Re: spermis] #191475 09/12/07 04:19 PM
Joined: Dec 2007
Posts: 2
L
LimonE Offline
Bowl of petunias
Offline
Bowl of petunias
L
Joined: Dec 2007
Posts: 2
$regsubex does only work in mIRC 6.17 or higher