SRL Archive - Web Development

MIRC 58X2 Bot -Help Fix?


Sandhu255

2013-01-08 21:36:03

It doesn't work for some reason, I was woundering if someone could help me fix it ?? :/

on *:TEXT:!58x2:#FCNAME: {
if ($nick isvoice $chan || $nick isreg $chan) { msg $chan 4only ranks may start a 58x2. | return }
if ($2 !ison $chan) { msg $chan $2 is not a valid nick. | halt }
if (!$3) { msg $chan Invalid format. Use: !58x2 user pot | halt }}
set $2 $3
var %preroll = $rand(2,100), %p = $gettok($3,3,32), %d2 = $gettok($2,2,32)
if (%preroll < 58) { msg $chan 4 $nick 9has rolled a 4[ %preroll ]9 sorry 4 %d2 9 you lost the %p pot! }
else { msg $chan 4 $nick 9has rolled a 4[ %preroll ]9 congrats 4 %d2 9 you won the %p pot!}
}

Ian

2013-01-08 21:37:34

I'm not sure that's pascal….

Where did you get it?

tom99

2013-01-08 21:45:58

its php post it here http://villavu.com/forum/forumdisplay.php?f=81

Sandhu255

2013-01-08 23:39:39

From: BMWxi
I'm not sure that's pascal….

Where did you get it?


I made it

Justin

2013-01-08 23:45:28

I have fixed your code up, see if this functions correctly.

[php]
on *:TEXT:!58x2:#FCNAME:{
if ($nick isvop #) or ($nick isreg #) {
msg # 4only ranks may start a 58x2.
halt
}
if ($2 !ison #) {
msg # $2 is not a valid nick.
halt
}
if (!$3) {
msg # Invalid format. Use: !58x2 user pot
halt
}
set $2 $3
var %preroll = $rand(2,100), %p = $gettok($3,3,32), %d2 = $gettok($2,2,32)
if (%preroll < 58) {
msg # 4 $nick 9has rolled a 4[ %preroll ]9 sorry 4 %d2 9 you lost the %p pot!
}
else {
msg # 4 $nick 9has rolled a 4[ %preroll ]9 congrats 4 %d2 9 you won the %p pot!}
}
}
[/php]

xtrapsp

2013-01-09 06:39:53

From: Sandhu255
It doesn't work for some reason, I was woundering if someone could help me fix it ?? :/


Dem standards are terrible.

Look at Justins post.

Also:

http://brian.moonspot.net/php-coding-standards

Sandhu255

2013-01-09 14:13:28

It still doesnt work, also changing $chan to #ChannelName does not make a diffrence. :/

Justin

2013-01-09 21:03:40

From: Sandhu255
It still doesnt work, also changing $chan to #ChannelName does not make a diffrence. :/


Can you post what is happing?