Script help! - 19/10/11 04:36 PM
Hello scripters!
I'm currently making a script for my bot, but I can't get it work.
I have 2 scripts (both are not mine). And I want to combine them together. But that's where the problems start.
Well the first script is a simple !treat script. When someone types !treat this will happen.
This is the whole script of that part.
The second script is a !give script. When you type !give (beer|pie|cookie|pluspoint|ban|pizza|love) it will give that person the treat.
This is the code for the !give section.
Well, as I said. I wanna combine these 2 scripts.
I want to link the !treat to !give.
So when the bot picks a name to give the treat to, the bot will use the !give command to give it.
But I can't figure out how.
Can someone please help me?
And I'm new to mIRC scripting. So please explain it too
Grtz. iFabber
I'm currently making a script for my bot, but I can't get it work.
I have 2 scripts (both are not mine). And I want to combine them together. But that's where the problems start.
Well the first script is a simple !treat script. When someone types !treat this will happen.
Code:
$me is thinking... Who should I give a treat to? I know it! %random-username! $me gives %random-username %treat!
This is the whole script of that part.
Code:
on $*:text:!treat:#:{ if (!%f) { inc -u12 %f :pickagain var %nick = $nick(#,$r(1,$nick(#,0))), %treat = beer|pie|cookie|pluspoint|ban|pizza|love if ($istok($me $nick,%nick,32)) { goto pickagain } else { describe # is thinking... .timertreat1 1 3 msg # Who should I give a treat to? .timertreat2 1 6 msg # I know it! .timertreat3 1 8 msg # %nick $+ ! .timertreat4 1 10 describe # gives %nick $+($gettok(%treat,$r(1,$numtok(%treat,124)),124),!) } } }
The second script is a !give script. When you type !give (beer|pie|cookie|pluspoint|ban|pizza|love) it will give that person the treat.
Code:
$nick gave %nick-receiver a %treat. This is %nick-receiver's %ammount %treat!
Code:
%treat == beer|pie|cookie|pluspoint|ban|pizza|love %ammount == Ammount of treats given. %nick-receiver == Person who will get the treat.
This is the code for the !give section.
Code:
on *:TEXT:!*:#: { if (!give isin $1-) && (!$4) { if ($2 ison $chan) { set %nick-receiver $2 } elseif ($3 ison $chan) { set %nick-receiver $3 } else { set %nick-receiver $nick } if (%nick-receiver == $me) { .timer 1 2 msg # Thank you $nick :) } if (cookie isin $1-) { set %cookie [ $+ [ %nick-receiver ] ] $calc(%cookie [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave %nick-receiver a cookie. This is %nick-receiver $+ 's $ord( %cookie [ $+ [ %nick-receiver ] ] ) cookie. | halt } elseif (pie isin $1-) { set %pie [ $+ [ %nick-receiver ] ] $calc(%pie [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave %nick-receiver a hot apple pie. This is %nick-receiver $+ 's $ord( %pie [ $+ [ %nick-receiver ] ] ) pie. | halt } elseif (beer isin $1-) { set %beer [ $+ [ %nick-receiver ] ] $calc(%beer [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave %nick-receiver a beer. This is %nick-receiver $+ 's $ord( %beer [ $+ [ %nick-receiver ] ] ) beer. | halt } elseif (pluspoint isin $1-) { set %pluspoint [ $+ [ %nick-receiver ] ] $calc(%pluspoint [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave2 %nick-receiver a pluspoint. This is %nick-receiver $+ 's $ord( %pluspoint [ $+ [ %nick-receiver ] ] ) pluspoint. | halt } elseif (ban isin $1-) { set %ban [ $+ [ %nick-receiver ] ] $calc(%ban [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave %nick-receiver a ban. This is %nick-receiver $+ 's $ord( %ban [ $+ [ %nick-receiver ] ] ) ban. | halt } elseif (pizza isin $1-) { set %pizza [ $+ [ %nick-receiver ] ] $calc(%pizza [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave %nick-receiver a hot large pizza. This is %nick-receiver $+ 's $ord( %pizza [ $+ [ %nick-receiver ] ] ) pizza. | halt } elseif (love isin $1-) { set %love [ $+ [ %nick-receiver ] ] $calc(%love [ $+ [ %nick-receiver ] ] + 1) | msg # $nick gave %nick-receiver love. This is the $ord( %love [ $+ [ %nick-receiver ] ] ) one who loves %nick-receiver | halt } } }
Well, as I said. I wanna combine these 2 scripts.
I want to link the !treat to !give.
So when the bot picks a name to give the treat to, the bot will use the !give command to give it.
But I can't figure out how.
Can someone please help me?
And I'm new to mIRC scripting. So please explain it too
Grtz. iFabber