Meta commented on a Page, Better way to write code for mIRC remote.ini  -  Jun 14, 2014

Based on your excerpt, it looks to me like you'll cut about 2/3rds of your script by removing all of the:

if ((%general) || ($($+(%,general.,$nick),2))) { return }
                set -u10 %general On
                set -u1800 %general. $+ $nick On

And checking that neither of the vars are set at the top of the script, and putting everything within that block instead:

(Also, I'm assuming you're using * as the matchtext for the event rather than trying to match every possible trigger, so if you want those vars to only be set if someone enters something that triggers a response by the bot, you can just add an else after all the text match conditions that unsets them)

on *:TEXT:*:#whatever:{
  if !%general && !%general. [ $+ [ $nick ] ] {
    set -u10 %general On
    set -u1800 %general. $+ $nick On


    else unset %general %general. $+ $nick

Note - There's no need to return, either.

By the way, depending on how you use timers, you may want to be wary of some issues mentioned this... This becomes especially important if your bot relays some part of the triggering text in its responses...

Also, this is not too important but in the following condition:

(*how are you* iswm $1-) || (*how are you? iswm $1-) || (*how are you ? iswm $1-)

Only the first would ever be met, so you could omit the other two... Additionally, ? would actually be considered a wildcard character here for a single (non-null) character... so something like *how are you? iswm $1- would be true for how are youa, how are you!, etc.

I'm also trying to think of with a better method for storing the responses and possible triggers, so I'll let you know when I come up with something.

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.