I have a script that enables you to add/remove bots to a database. Well, everything works except for one part, I want it to remove the entry; yes, but i want it to leave the line there, so all the number say the same. ex.
1. test
3. test
so that way, if you delte 2, it WONT look like this:
1. test
3. test
thus making 3 report as 2, yada yada yada. Ill highligh the part of the code to look at. thanks.
on *:TEXT:!bot*:#ftpxdcc-wolf-botholding:{
if ($nick isop $chan) {
if ($2 == add) {
set %bot_sub $nick
set %bot_ip $3
set %bot_speed $4
set %bot_nick $5
set %bot_admin $6
set %bot_owner $7
set %bots $calc(%bots + 1)
write xdccbots.txt 12 %bots $+ . «« Bot.IP: %bot_ip »» «« Bot.Pass: %bot_admin »» «« Bot.Nick: %bot_nick »» $&
«« Bot.Owner: %bot_owner »» «« Bot.Speed: %bot_speed »»7 sub. by %bot_sub
unset %bot_sub
unset %bot_ip
unset %bot_speed
unset %bot_owner
unset %bot_admin
unset %bot_nick
.notice $nick 12Bot Stored - Thankyou
.notice $nick 12Entry Number:7 %bots
goto done
}
if ($2 == remove) {
set %bot_deletego 1
set %bot_lineremove $3
set %bot_tempok $nick
.notice $nick 4!WARNING! 1This Will Delete The Bot Off The Database FOREVER. Continue? (Y/N) 4!WARNING!
}
if ($2 == read) {
set %bot_line $3
set %bot_readline $read(xdccbots.txt, %bot_line)
.notice $nick %bot_readline
.notice $nick 4Done
unset %bot_line
unset %bot_readline
goto done
}
if ($2 == help && $3 == $null) {
.notice $nick 12XDCC Bot Database 7[Entrys: %bots $+ ]
.notice $nick 1Command listing and bot help
.notice $nick 1syntax: 4!bot <command> (parameter(s))
.notice $nick 12TOPICS:
.notice $nick 4HELP 1 $chr(124) 4 ADD 1 $chr(124) 4 REMOVE 1 $chr(124) 4 READ 1 $chr(124) $&
12 SEND 1 $chr(124) 12 BACKUP 1 $chr(124) 7 RESET
.notice $nick 1-
.notice $nick 4Red: Any op
.notice $nick 12Blue: Authorized OP's only
.notice $nick 7Orange: Me :-]
goto done
}
elseif ($2 == help && $3 == add) {
.notice $nick 12XDCC Bot Database 7[Entrys: %bots $+ ]
.notice $nick 1syntax: 4!bot add <ip> <speed> <nick> <admin pass> <owner>
.notice $nick 12You MUST set all fields!
goto done
}
elseif ($2 == help && $3 == remove) {
.notice $nick 12XDCC Bot Database 7[Entrys: %bots $+ ]
.notice $nick 1syntax: 4!bot remove <bot number>
.notice $nick 12Ranges NOT supported yet. soon.
goto done
}
:done
halt
}
}
[color:blue]
on *:TEXT:y:#ftpxdcc-wolf-botholding:{
if (%bot_deletego == $null) halt
if (%bot_deletego == 1) {
.notice $nick 4Deleting $read(xdccbots.txt, %bot_lineremove)
write -ds $+ %bot_lineremove $+ . xdccbots.txt
unset %bot_deletego
unset %bot_lineremove
unset %bot_tempok
}
}
[/color]
on *:TEXT:n:#ftpxdcc-wolf-botholding:{
if (%bot_deletego == $null) halt
if (%bot_deletego == 1) {
.notice $nick 4Cancled Delete
unset %bot_deletego
unset %bot_lineremove
unset %bot_tempok
}
}