Simple script I whipped up for a game I play while waiting for the new year :D
It's pretty self-explanatory
Constructive criticism welcome :D
Enjoy!
on *:text:!ticketprice*:#:{
if (!$2) { msg # 4 Usage: !ticketprice price }
elseif ($2 == %ticketprice) { msg # 4 $2 is already the ticket price }
else {
set %ticketprice $2
msg # 12 The new ticket price is $2
}
}
on *:text:!currentticketprice:#:{
if (%ticketprice == $null) { msg # 4 There is no ticket price set }
else {
msg # 12 Ticket Price: %ticketprice
}
}
on *:text:!ticketamount*:#:{
if (!$2) { msg # 4 Usage: !ticketamount amount }
elseif ($2 == %ticketamount) { msg # 4 $2 is already the amount of tickets that you have }
else {
set %ticketamount $2
msg # 12 Your new ticket amount is $2
}
}
on *:text:!currentticketamount:#:{
if (%ticketamount == $null) { msg # 4 There is no ticket amount set }
else {
msg # 12 Ticket amount: %ticketamount
}
}
One critical matter to put into consideration: the $2 can be anything that people enter, so you need to make sure it is a number and nothing else by making an if check:
if ($2 !isnum) { msg # 4 Usage: !ticketprice price }
Unless, of course, you mean prize, not price. There is a difference between these two words.