5618 has a good point, especially for usage in scripts, but if you really want to detect commands typed into the editbox when offline you can use the following method:
on *:input:*:{
if ($status == disconnected) {
if (/* iswm $1) && (!$ctrlenter) {
scon -r $1-
}
else {
; handle 'You are not on a channel' errors here
}
halt
}
return
:error
if ($(& & not connected to server*) iswm $error) {
reseterror
; handle 'not connected to server' errors here
halt
}
}
note that this doesn't detect commands input using the '!' command prefix; those will bypass the event.
some things to think about for a general purpose solution that i didn't include for the sake of providing a simple example:
- alternative command prefix (read from $mircini)
- $inpaste for pastes into a single line editbox
- custom aliases or identifiers called that themselves execute commands that cannot be used offline