!start and !stop no problem ... but !pause and !resume i cant really figure it out i messed the code so far that i didnt know what ive done good or wrong..
This is the code i managed to save upon now..
Code: Select all
bind PUB - !start pub:prestart
bind PUB - !pause pub:pause
bind PUB - !resume pub:resume
bind PUB - !stop pub:stop
proc pub:prestart {nick uhost hand chan arg} {
global class
set class(end) 0
set class(numara) -1
set class(linie) -1
class:start $chan $nick
}
proc class:start {chan nick} {
global class
set of [open class]
incr class(numara)
while {[gets $of line] ne -1} {
incr class(linie)
if {$class(end)} { close $of; putlog "Ne oprim"; return }
if {$class(numara) eq $class(linie)} {
putserv "PRIVMSG $chan :$line"
close $of
}
}
class:start $chan $nick
}
proc pub:stop {nick uhost hand chan arg} {
global class
if {![info exists class(start)]} { putquick "PRIVMSG $chan :\002::\002 Nu ruleaza nimic nu am ce opri"; return }
set class(end) 1
putquick "PRIVMSG $chan :\002::\002 Am oprit cu succes"
}