mIRC Home    About    Download    Register    News    Help

Print Thread
#3455 25/12/02 03:09 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
this is what im trying to do,
i have a game of sorts,
and when someone wins
on *:text:Ms_7-11 guess*:#Praise-Him:{
if ($3 == %guessnum1) { /msg #Praise-Him 1,8 $nick Got The Right Number It Was %guessnum1 !!!!! | /halt }
if ($3 < %guessnum1) { /msg #Praise-Him 2,13Sorry $nick The Number Is Higher Than $3 | /halt }
if ($3 > %guessnum1) { /msg #Praise-him 6,15Sorry $nick The Number Is Lower Than $3 | /halt }
}
}
ill have it write to a text file the name of the winner
is there a way for me to have it write the nick and times won
so if a nick won 3 times it would return the result like nick 3 or 3 nick

and then how would i script something to return the highest number of wins?

any ideas?

#3456 25/12/02 04:57 PM
Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Maybe somthing like this. I hope this is what you need! smirk

Code:
on *:text:Ms_7-11 guess*:#Praise-Him: {
  if ($3 == %guessnum1) { 
    msg $chan 1,8 $nick Got The Right Number It Was %guessnum1 $+ !!!!! ( $+ $nick has winned, $read(text.txt, s, $nick) $+ times!
    set %variables $read(text.txt, s, $nick)
    write -ds $+ $nick text.txt
    write text.txt $nick $calc(%variables + 1)
  }
  if ($3 &lt; %guessnum1) {
    msg $chan 2,13Sorry $nick The Number Is Higher Than $3
    halt
  }
  if ($3 &gt; %guessnum1) {
    msg $chan 6,15Sorry $nick The Number Is Lower Than $3
    halt
  }
}

#3457 26/12/02 02:33 AM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
works perfect smile thanks alot

#3458 26/12/02 01:09 PM
Joined: Dec 2002
Posts: 109
T
Vogon poet
Offline
Vogon poet
T
Joined: Dec 2002
Posts: 109
.. you can do it without writing to a file, makes more sense to use builtin variables, that's what they are there for smile
the /halt isn't neccesary either, it just means you won't be able to see what they wrote. Which is silly smile

Code:
on *:text:Ms_7-11 guess*:#Praise-Him: {
  if ($3 == %guessnum1) { inc %won. [ $+ [ $nick ] ] | msg $chan 1,8 $nick Got The Right Number It Was %guessnum1 $+ !!!!! ( $+ $nick has won %won. [ $+ [ $nick ] ] in a row!) }
  elseif ($3 &lt; %guessnum1) msg $chan 2,13Sorry $nick The Number Is Higher Than $3
  elseif ($3 &gt; %guessnum1) msg $chan 6,15Sorry $nick The Number Is Lower Than $3
}


<Ingo> I can't uninstall it, there seems to be some kind of "Uninstall Shield"
#3459 26/12/02 05:19 PM
Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
np smirk


Link Copied to Clipboard