on *:TEXT:!on*:#:{
if ($nick == tylersgaming) {
if ($read(botstatus.txt,t,1) == on) {
}
if ( $read(botstatus.txt,t,1) == off) {
/write -c botstatus.txt
/timerAward 0 1800 /awardPoints $chan
write botstatus.txt on
msg $chan Points will now be awarded.
}
}
}
on *:TEXT:!off*:#:{
if ($nick == tylersgaming) {
if ($read(botstatus.txt,t,1) == off) {
}
if ( $read(botstatus.txt,t,1) == on) {
/write -c botstatus.txt
write botstatus.txt off
/timerAward off
msg $chan Points will no longer be awarded.
}
}
}
alias awardpoints {
var %chan = $$1, %table = coins. $+ %chan, %file = C:\Users\TylersGaming\Dropbox\coins.ini
if (!$hget(%table)) {
hmake %table
if ($ini(%file,%chan)) hload -i %table %file %chan
}
var %i = 1, %n = $nick(%chan,0)
while (%i <= %n) {
hinc %table $nick(%chan,%i)
inc %i
}
hdel %table nightbot
hdel %table tylerb0t
hdel %table tylersgaming
hsave -i %table %file %chan
alias copy_coins {
echo -a Moving coins initialized
var %file1 $qt(old coins.ini)
var %file2 $qt(new coins.ini)
var %sec #tylersgaming
var %items $ini(%file1,%sec,0)
while (%items) {
var %item $ini(%file1,%sec,%items)
var %value1 $readini(%file1,%sec,%item)
var %value2 $readini(%file2,%sec,%item)
if (%value2) writeini %file2 %sec %item $calc(%value1 + %value2)
else writeini %file2 %sec %item %value1
dec %items
}
echo -a Moving coins finished
}