Meta

Meta

Joined
Jan 05, 2010
Location
Somewhere...

Activity Stream

Meta commented on a Comment, How to do /me on mIRC  -  Sep 08, 2014
Meta commented on a Comment, Custom Command Adding and Deleting Script  -  Aug 15, 2014
Meta commented on a Comment, Roulette need help script only work for mods/broadcaster  -  Jul 25, 2014
Meta commented on a Page, Roulette need help script only work for mods/broadcaster  -  Jul 25, 2014

This block:

if ($nick isop #) {
    var %randmods = $rand(1,1)
    if (%randmods == 1) msg $chan Nazi mods are only released upon spam DansGame you know that $nick ...
  }

Is essentially just:

if ($nick isop #) msg $chan Nazi mods are only released upon spam DansGame you know that $nick ...

I'm not sure if that's what you want, or you're just saving that block for more options later, but anyway.

You're missing a { after if (%randnumber == 1), and you will need to close the event with a third } at the end. The else in else (%randnumber == 3) should also be changed to elseif. Finally, you're missing the (I presume) msg command before $chan for both /timeouts

Meta commented on Buggsy's Thread  -  Jun 17, 2014
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

    ; TEXT MATCH CONDITIONS AND RESPONSES HERE

    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.

 Respond  
Meta commented on a Page, RGBMixer - An alias to equally blend two rgb values  -  Apr 19, 2014

Shouldn't you be adding the two like values together and dividing by two..?

Meta commented on duckz's Thread  -  Apr 07, 2014
Meta commented on ProIcons's Thread  -  Apr 06, 2014
Meta commented on a Comment, Help coding Random Reply mIRC  -  Apr 05, 2014
Meta commented on a Comment, Help coding Random Reply mIRC  -  Apr 03, 2014
Meta commented on a Page, Help coding Random Reply mIRC  -  Apr 02, 2014

You're on the right track; the main problem is the parentheses around the $rand(1,3) -- It should just be:

var %randnumber $rand(1,3)

otherwise the ( ) will be part of the variable, (e.g. ( 1) rather than 1)

 Respond  
Meta commented on a Comment, here  -  Mar 30, 2014
Meta commented on Hawkee's Thread  -  Mar 22, 2014
Meta commented on Farcrada's Thread  -  Mar 21, 2014
Meta commented on Truk's Thread  -  Feb 21, 2014
Meta commented on Conscious's Thread  -  Feb 19, 2014
Meta commented on Menteroth's Thread  -  Nov 21, 2013
Meta commented on Menteroth's Thread  -  Nov 20, 2013
Meta commented on a Comment, DDO style dice  -  Nov 11, 2013
Meta commented on a Comment, Typos Highlighter  -  Nov 06, 2013
Meta commented on Chromatic's Thread  -  Nov 06, 2013
Meta commented on AnneChoV's Thread  -  Nov 05, 2013
Meta commented on Chromatic's Thread  -  Nov 04, 2013
Meta commented on Menteroth's Thread  -  Nov 01, 2013
Meta commented on Menteroth's Thread  -  Oct 30, 2013
Meta commented on F*U*R*B*Y*'s Thread  -  Oct 27, 2013
Meta commented on a Page, Wildcard Nick List  -  Oct 26, 2013

Lol why not regex?

alias nicksearch {
  var %r $regsubex($str(.,$nick($1,0)),/./g,$iif( [ $2 ] iswm $nick( [ $1 ] ,\n),$v2 $+ $chr( [ $3 ] )))
  return $deltok($iif($4,$sorttok(%r,$3),%r),,$3)
}

Edit: Don't need a capture group. Also, now removes null tokens.

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.