Need some help to finish the script - 06/02/10 10:35 PM
So this is the script i need help with:
on *:text:*!player *:#: {
if ($sock(!player)) .sockclose !player
set %heraldchan $chan
set %heraldnick $nick
set %heraldplayer $2
sockopen !player herald.uthgard-server.net 80
}
on *:SOCKOPEN:!player: {
sockwrite -nt $sockname GET /herald.php?view=stats&p1=player&p2=Player&p3=DESC&p5=Player&p6= $+ %heraldplayer HTTP/1.1
sockwrite -nt $sockname Host: herald.uthgard-server.net
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:!player: {
if ($sockerr) {
msg %chan Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
halt
}
else {
var %sockreader
sockread %sockreader
if (*Realmrank* iswm %sockreader ) {
set %heraldplayer1 $remove($nohtml(%sockreader),Realmrank)
msg %heraldchan .g That player is RR %heraldplayer1
unset %heraldchan %heraldnick %heraldplayer %heraldplayer1
sockclose !player
}
}
}
The problem is that the bot cant understand a command line after SPACE
Example1 (Working):
[00:31] <[NSS]Ati> !player Crossfire
[00:31] <[NSS]HeraldBot> .g That player is RR 8L1
Example2 (Working):
[00:32] <[NSS]Ati> nospacehere!player Dwain
[00:32] <[NSS]HeraldBot> .g That player is RR 6L1
Example3 (Not Working):
[00:32] <[NSS]Ati> hereisspace !player Ati
No responce by bot
Example4 (Not Working):
[00:31] <[Uth]Guildbot2> Dwain: "!player ati"
No responce by bot
So as i want to make the heraldbot compatible with with game via IRC and there game bot leaves SPACE between text then i cant get it work.
A help would be a priciated =)
Best Regards,
NSS-HeraldBot
on *:text:*!player *:#: {
if ($sock(!player)) .sockclose !player
set %heraldchan $chan
set %heraldnick $nick
set %heraldplayer $2
sockopen !player herald.uthgard-server.net 80
}
on *:SOCKOPEN:!player: {
sockwrite -nt $sockname GET /herald.php?view=stats&p1=player&p2=Player&p3=DESC&p5=Player&p6= $+ %heraldplayer HTTP/1.1
sockwrite -nt $sockname Host: herald.uthgard-server.net
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:!player: {
if ($sockerr) {
msg %chan Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
halt
}
else {
var %sockreader
sockread %sockreader
if (*Realmrank* iswm %sockreader ) {
set %heraldplayer1 $remove($nohtml(%sockreader),Realmrank)
msg %heraldchan .g That player is RR %heraldplayer1
unset %heraldchan %heraldnick %heraldplayer %heraldplayer1
sockclose !player
}
}
}
The problem is that the bot cant understand a command line after SPACE
Example1 (Working):
[00:31] <[NSS]Ati> !player Crossfire
[00:31] <[NSS]HeraldBot> .g That player is RR 8L1
Example2 (Working):
[00:32] <[NSS]Ati> nospacehere!player Dwain
[00:32] <[NSS]HeraldBot> .g That player is RR 6L1
Example3 (Not Working):
[00:32] <[NSS]Ati> hereisspace !player Ati
No responce by bot
Example4 (Not Working):
[00:31] <[Uth]Guildbot2> Dwain: "!player ati"
No responce by bot
So as i want to make the heraldbot compatible with with game via IRC and there game bot leaves SPACE between text then i cant get it work.
A help would be a priciated =)
Best Regards,
NSS-HeraldBot