mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2007
Posts: 3
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jun 2007
Posts: 3
hi everyone, i have two scripts that i want help with a few modifications. the first one is my insult script, here is the script itself

Code:
on *:text:!insult &:#: {
  insult $2
}
alias insult {
  if (!$exists(insultd.ini)) { echo -a Cannot find insults file (insultd.ini). Make sure its in the same dir as mirc.exe! | halt } 
  %bl4h.insadj1 = $readini(insultd.ini,adj,adj $+ $rand(1,$readini(insultd.ini,adj,total)))
  %bl4h.insadj1 = $gettok(%bl4h.insadj1,$rand(1,$gettok(%bl4h.insadj1,0,32)),32)
  %bl4h.insadj2 = $readini(insultd.ini,adj,adj $+ $rand(1,$readini(insultd.ini,adj,total)))
  %bl4h.insadj2 = $gettok(%bl4h.insadj2,$rand(1,$gettok(%bl4h.insadj2,0,32)),32)
  %bl4h.insamt = $readini(insultd.ini,amt,amt $+ $rand(1,$readini(insultd.ini,amt,total)))
  %bl4h.insamt = $gettok(%bl4h.insamt,$rand(1,$gettok(%bl4h.insamt,0,32)),32)
  %bl4h.insnoun = $readini(insultd.ini,noun,noun $+ $rand(1,$readini(insultd.ini,noun,total)))
  %bl4h.insnoun = $gettok(%bl4h.insnoun,$rand(1,$gettok(%bl4h.insnoun,0,32)),32)
  /msg $chan 10 $1, You are nothing but a $replace(%bl4h.insadj1,$chr(124),$chr(32)) $replace(%bl4h.insamt,$chr(124),$chr(32)) of $replace(%bl4h.insadj2,$chr(124),$chr(32)) $replace(%bl4h.insnoun,$chr(124),$chr(32))
}
on *:text:!insult &:#: {
  insult $2
}

the only problem with this script is that it will also work if someone uses the command to get the bot to insult itself, since i like to keep the image that my bot is a separate intelligent entity, that doesnt look too good. is there any way to make it that the script will not work if it is used on the nick "snowbot" and will instead say something like "nice try, but i wont insult myself"? thanks alot.

my next script is a botsnack script run by attaching responses to a random number generator. here is the script:
Code:
on *:TEXT:!botsnack*:#:{
  /set %botsnack $rand(1,6) 
  if (%botsnack == 1) .msg $chan 10Thanks alot $nick $+ !
  if (%botsnack == 2) .msg $chan 10Yummy! 
  if (%botsnack == 3) .msg $chan 10:) 
  if (%8botsnack == 4) .msg $chan 10Thanks $nick $+ ! I was getting hungry! 
  if (%botsnack == 5) .msg $chan 10I like being fed by other people!
  if (%botsnack == 6) .msg $chan 10Thanks $nick $+ ! I like snacks! 
}                                                                                                                       

My question is, is it possible to make it so that if someone uses the botsnack command up to 30 seconds after someone else uses it, it will say, "sorry but I'm full at the moment"? maybe this could be done with a timer? (if so, can someone show me how that could be done?)

thanks alot in advance for the help

Coreymon77
PS if it is impossible to do these things, just tell me

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
on *:text:!insult &:#: {
  if ($2 == $me) .msg $chan nice try, but i wont insult myself
  else { insult $2 }
}

alias insult {
  if (!$exists(insultd.ini)) { echo -a Cannot find insults file (insultd.ini). Make sure its in the same dir as mirc.exe! | halt } 
  %bl4h.insadj1 = $readini(insultd.ini,adj,adj $+ $rand(1,$readini(insultd.ini,adj,total)))
  %bl4h.insadj1 = $gettok(%bl4h.insadj1,$rand(1,$gettok(%bl4h.insadj1,0,32)),32)
  %bl4h.insadj2 = $readini(insultd.ini,adj,adj $+ $rand(1,$readini(insultd.ini,adj,total)))
  %bl4h.insadj2 = $gettok(%bl4h.insadj2,$rand(1,$gettok(%bl4h.insadj2,0,32)),32)
  %bl4h.insamt = $readini(insultd.ini,amt,amt $+ $rand(1,$readini(insultd.ini,amt,total)))
  %bl4h.insamt = $gettok(%bl4h.insamt,$rand(1,$gettok(%bl4h.insamt,0,32)),32)
  %bl4h.insnoun = $readini(insultd.ini,noun,noun $+ $rand(1,$readini(insultd.ini,noun,total)))
  %bl4h.insnoun = $gettok(%bl4h.insnoun,$rand(1,$gettok(%bl4h.insnoun,0,32)),32)
  msg $chan 10 $1, You are nothing but a $replace(%bl4h.insadj1,$chr(124),$chr(32)) $replace(%bl4h.insamt,$chr(124),$chr(32)) of $replace(%bl4h.insadj2,$chr(124),$chr(32)) $replace(%bl4h.insnoun,$chr(124),$chr(32))
}

on *:TEXT:!botsnack*:#:{
  if (!%botsnack) {
    set -u30 %botsnack $rand(1,6)
    if (%botsnack == 1) .msg $chan 10Thanks alot $nick $+ !
    if (%botsnack == 2) .msg $chan 10Yummy! 
    if (%botsnack == 3) .msg $chan 10:) 
    if (%botsnack == 4) .msg $chan 10Thanks $nick $+ ! I was getting hungry! 
    if (%botsnack == 5) .msg $chan 10I like being fed by other people!
    if (%botsnack == 6) .msg $chan 10Thanks $nick $+ ! I like snacks! 
  }
  else .msg $chan sorry but I'm full at the moment
} 

Joined: Jun 2007
Posts: 3
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jun 2007
Posts: 3
thanks, the insult one works, but the botsnack one doesnt, the way you had it made it so that it always said that it was not hungry, i want it so that it will work when someone does it, but if someone else does it again up to 30 seconds after the first person did, then it will say im not hungry


Link Copied to Clipboard