mIRC Home    About    Download    Register    News    Help

Print Thread
R
Rebmemdlog
Rebmemdlog
R
Hi,

This might sound a little silly but i would like to request a script that keeps track of numbers and increments its value with 1 each time someone types !dollar

how to explain this more simple. lol
i want to have a script that starts at 0
each time someone does !dollar, it has to add 1 to the total.
it can go on untill the number of 1000 is reached.

it also has to be possible to reset the score.

can anyone make me a script like this? smile

thanks in advance

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Code:
on *:text:!dollar:#:{ idollar }
on *:text:!resetdollar:#:{ rdollar }
alias rdollar { unset %dollar }
alias idollar {
  if (!%dollar || %dollar < 1000) { inc %dollar }
}


You personally can type: /idollar, to increase %dollar by one, if %dollar is 1000 (or more) it will not increase it. If you type: /rdollar, it will unset %dollar so that it holds no value.

If someone in a channel with you types: !dollar
This will increase %dollar by one, but not if it's 1,000 or more.

If someone in a channel with you types: !resetdollar
This will unset %dollar.

R
Rebmemdlog
Rebmemdlog
R
thanks alot!!! very fast reply!

but i am affraid i forgot to give some more information lol sorry.

what code will i have to add if i want it to say the following text to the channel after someone did !dollar <nickname>

$1 dollar was added by <nickname>. the score is now: $...


and "score was reset by <nickname>
after they use the reset command

Last edited by Rebmemdlog; 28/08/06 12:36 PM.
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Code:
on *:text:!dollar:#:{
  idollar
  msg $chan Dollar added by $nick
}
on *:text:!resetdollar:#:{
  rdollar
  msg $chan Score reset by $nick
}
alias rdollar { unset %dollar }
alias idollar {
  if (!%dollar || %dollar &lt; 1000) { inc %dollar }
}


Do you want the "dollar" to be seperate for each nick? Or just the same "dollar" variable for everyone? The above is just one "dollar" for everyone.

If you want each nick to have their own %dollar, and use: !dollar nick, to increase a dollar for a nick, you'd have to use something like:

Code:
on *:text:!dollar &amp;:#:{
  idollar $2
  msg $chan $nick adds a dollar to $2
}
on *:text:!resetdollar &amp;:#:{
  rdollar $2
  msg $chan Score reset by $nick
}
alias rdollar { unset %dollar. [ $+ [ $1 ] ] }
alias idollar {
  if (!%dollar. [ $+ [ $1 ] ] || %dollar. [ $+ [ $1 ] ] &lt; 1000) {
    inc %dollar. [ $+ [ $1 ] ]
  }
}


This would require the person to type: !dollar somenick
And to reset it: !resetdollar somenick

If you want to add a dollar or unset, you can use: /rdollar nick, and /idollar nick


Enjoy.

R
Rebmemdlog
Rebmemdlog
R
Thanks!! laugh

this script is almost perfect! just one minor detail smile

----

on *:text:!dollar:#:{ idollar msg $chan Dollar added by $nick}on *:text:!resetdollar:#:{ rdollar msg $chan Score reset by $nick}alias rdollar { unset %dollar }alias idollar { if (!%dollar || %dollar < 1000) { inc %dollar }}

---


if i type !dollar it says: a dollar was added by $nick

what do i need to adjust if i want it to say

a dollar was added by johndoe

after i have typed !dollar johndoe

Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Just change this line:
on *:text:!dollar:#:{ idollar msg $chan Dollar added by $nick }

To:
on *:text:!dollar:#:{ idollar msg $chan Dollar given to $2 }

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
OrionsBelt: Your changed code should read
on *:text:!dollar*:#:{ idollar msg $chan Dollar given to $2 }

You need the wildcard after !dollar in order for the $2 to be set

R
Rebmemdlog
Rebmemdlog
R
thanks guys! you are all very helpful! smile
the script works exactly the way i want it to work now smile

Code:
  
on *:text:!dollar *:#:{  
  idollar  
  msg $chan 6a dollar was added by $2
  msg $chan 6the score is now %dollar dollar :)
}
on *:text:!dollar:#:{  
  idollar  
  msg $chan 6a dollar was added by $nick
  msg $chan 6the score is now %dollar dollar :)
}
on 500:text:!resetdollar:#:{  
  rdollar  
  msg $chan 6score reset by $nick
}
on *:text:!dollarstatus:#:{  
  msg $chan 6the score is now %dollar dollar :)
}
on *:text:!dollarhelp:#:{  
  msg $chan 6type !dollar to donate a dollar on behalf of yourself
  msg $chan 6type !dollar &lt;nickname&gt; to donate a dollar on behalf of someone else
  msg $chan 6type !dollarstatus to list the current score
  msg $chan 6type !resetdollar to reset the score (admin only)
}
alias rdollar { 
  unset %dollar 
}
alias idollar {  
  if (!%dollar || %dollar &lt; 1000) { inc %dollar }
}




maybe you guys are willing to help me out with another additional feature smile
to output a list of users with the amount of dollars they have donated after someone types !list or something.

what would be needed to done with the code?


Link Copied to Clipboard