on *:JOIN:#: {
var %user $nick
if ($readini(rxcoin.ini,#michaelukz,%user,coins) != $null) {
writeini -n rxcoin.ini #michaelukz $nick coins $calc($readini(rxcoin.ini,#michaelukz,%user,coins) + 0)
var %var $readini(rxcoin.ini,#michaelukz,%user,coins)
}
else {
writeini -n rxcoin.ini #michaelukz $nick coins 1
var %coin $readini(rxcoin.ini,#michaelukz,%user,coins)
}
}
on *:TEXT:!balbusers *:#: {
var %user $nick
var %val $readini(rxcoin.ini,#michaelukz,%user,coins)
if ($nick isop #michaelukz) {
if ($2 == null) {
msg $chan /me >: Please supply a name to read.
}
msg $chan /me >: $2 has %val credits.
}
}
on *:TEXT:!balance:#: {
var %user $nick
var %val $readini(rxcoin.ini,#michaelukz,%user,coins)
if (%val == $null) {
msg $chan /me >: You have no credits, $nick
}
msg $chan /me >: $nick has %val credits.
}
on *:TEXT:!givecreds *:#: {
var %user $nick
var %val $readini(rxcoin.ini,#michaelukz,%user,coins)
if ($nick isop #michaelukz) {
if ($2 == $null) {
msg $chan /me >: Please enter a name to give credits too.
}
if ($3 == $null) {
msg $chan /me >: Please enter the number of credits to give.
}
msg $chan $2 has been given $3 credits
set %money.add $calc( $readini(rxcoin.ini,#michaelukz,%user,coins) + $3 )
writeini -n rxcoin.ini #michaelukz %user coins %money.add
unset %money.add
}
}
on *:TEXT:!dcreds *:#: {
var %user $nick
var %val $readini(rxcoin.ini,#michaelukz,%user,coins)
if ($2 == $null) {
msg $chan /me >: Please insert a name to send credits too.
}
if ($3 == $null) {
msg $chan /me >: Please enter the number of credits to give.
}
if (%val == $null) {
msg $chan /me >: You have no credits to give!
}
if (%val == 0) {
msg $chan /me >: You have no credits to give!
}
msg $chan /me >: $2 has been given $3 tokens by $nick
set %money.add $calc( $readini(rxcoin.ini,#michaelukz,$2,coins ) + $3 )
set %money.withdraw $calc( $readini( rxcoin.ini,#michaelukz,%user,coins) - $3 )
writeini -n rxcoin.ini #michaelukz %user coins %money.withdraw
writeini -n rxcoin.ini #michaelukz $2 coins %money.add
unset %money.add
unset %money.withdraw
}