Random number or text genorator

By jakobLUVSpizza on Aug 19, 2008

This is a very simple Random number or text script.

============================================================================================
                                   *UPDDATE*
============================================================================================
on *:TEXT:!random*:#:{
  if ($2 == number) {
    msg $chan $r(1,10) %+ $r(1,10) $+ $r(1,10)
  }
  elseif ($2 == text) {
    msg $chan $r(a,z) $+ $r(a,z) $+ $r(a,z) $+ $r(a,z)
  }
  else {
    msg $chan $nick Please select either Number or Text.
  }
}

Comments

Sign in to comment.
pwnisher3   -  Aug 23, 2008

closing brachet -_-

 Respond  
deejay8   -  Aug 23, 2008

u forgot the last } on the update jakob

 Respond  
jakobLUVSpizza   -  Aug 23, 2008

yeah, thanks...i see what you mean

 Respond  
vaseline28   -  Aug 20, 2008

Nice script!
I think a good idea would be to use else-if instead. If you use this, then mIRC will automatically skip the stage if it has already found the answer, thus meaning the script doesn't keep looking:

on *:TEXT:!random*:#:{
  if ($2 == number) {
    msg $chan $rand(1,10) %+ $rand(1,10) $+ $rand(1,10)
  }
  elseif ($2 == text) {
    msg $chan $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z)
  }
  else {
    msg $chan $nick Please select either Number or Word.
  }
}

If anything which is NOT number or text is typed, then the script tells them what to select!

 Respond  
jakobLUVSpizza   -  Aug 20, 2008

...? lol

 Respond  
napa182   -  Aug 19, 2008

you could do

on *:TEXT:!random*:#:{ 
  if ($2) { msg # $iif($2 == number,$+($r(1,10),$r(1,10),$r(1,10)),$iif($2 == text,$+($r(a,z),$r(a,z),$r(a,z),$r(a,z)))) }
  else { msg $chan $nick Please Type either !random number or !random text }
}
 Respond  
jakobLUVSpizza   -  Aug 19, 2008

there, now i have it

 Respond  
deejay8   -  Aug 19, 2008

k

 Respond  
deejay8   -  Aug 19, 2008

just used what mountaindew post

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

ok, thanks so i had that part right in the first place

 Respond  
deejay8   -  Aug 19, 2008

wait

 Respond  
guest598594   -  Aug 19, 2008

No, $number and $text aren't valid identifiers ;)

$null is right though.

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

dj told me to have $number abd $text.....i think

on the script the
if ($2 == $something)

??????

 Respond  
guest598594   -  Aug 19, 2008
on *:TEXT:!random*:#:{
  if ($2 == number) {
    msg $chan $rand(1,10) %+ $rand(1,10) $+ $rand(1,10)
  }
  if ($2 == text) {
    msg $chan $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z)
  }
  if ($2 == $null) {
    msg $chan $nick Please select either Number or Word.
  }
}

By the way, you have $number and $text

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

i fixed that already

 Respond  
deejay8   -  Aug 19, 2008

u still have
if($2 == something) {
u need a space affer
if

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

i have the closing brackets but ok

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

mountaindwe, mountaindew is awesome!!!!!!!!!!! its my faveorite

 Respond  
guest598594   -  Aug 19, 2008

^^ Still need closing brackets and you need a space between ")" and "{"

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

ok, i think i fixed it

 Respond  
deejay8   -  Aug 19, 2008

oh yah mountaindew i forgot

on *:TEXT:!random*:#:{
  if ($2 == number) {
   msg $chan $rand(1,10) %+ $rand(1,10) $+ $rand(1,10)
  if ($2 == text) {
   msg $chan $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z)
  if ($2 == $null) {
   msg $chan $nick Please select either Number or Word.
}
 Respond  
jakobLUVSpizza   -  Aug 19, 2008

huh?

 Respond  
deejay8   -  Aug 19, 2008

mountaindew i had him removed it

 Respond  
jakobLUVSpizza   -  Aug 19, 2008

check it now...............yes or no?!?!?!?

 Respond  
guest598594   -  Aug 19, 2008

Not only as Dj said ^^ but you need to use brackets { } also

if ($2 == number) {
  msg ...
}
 Respond  
deejay8   -  Aug 19, 2008

that sould work

 Respond  
deejay8   -  Aug 19, 2008

on the script the
if ($2 == $something)
u have them like this
if($2 == $something)
so it won't work

on *:TEXT:!random*:#:{
  if ($2 == number)
   msg $chan $rand(1,10) %+ $rand(1,10) $+ $rand(1,10)
  if ($2 == text)
   msg $chan $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z)
  if ($2 == $null)
   msg $chan $nick Please select either Number or Word.
}
 Respond  
jakobLUVSpizza   -  Aug 19, 2008

i dont get it.....WHAT????????????????????????????????????/

 Respond  
Cheiron   -  Aug 19, 2008

what with the 10 rating for a code that needs editing for it to be correct

 Respond  
deejay8   -  Aug 19, 2008

ok thank you

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.