• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Page 1 of 3 1 2 3 >
Topic Options
Rate This Topic
#259 - 12/10/07 02:42 PM Triggers (like !rules)
usrbingeek Offline

WyldRyde Staff

Registered: 07/31/06
Posts: 646
Loc: Burlington, VT
If you'd like to create some !triggers for your channel copy and paste this script in to your Remotes in mIRC.

Note: You'll need to make some modifications before it'll be ready to use. These modifications are explained below the code. Also, these triggers cannot be invoked by you if they're running on the copy of mIRC you are using to chat. So, if you wish to invoke these triggers yourself you'll need to run two copies of mIRC. One for you to chat with and another one that'll run this script (and possibly others. It'll essentially be a "bot.")

Code:
on 1:text:!rules:#channel: {
    if (($calc(($ctime - %lastupdatetime)) >= 15) || (!%lastupdatetime)) {
      set %lastupdatetime $ctime
  /msg $chan Your-rules-or-message-goes-here 
  }
}


You'll need to change #channel on the 1st line to your channel's name.

The 2nd and 3rd line calculates how long ago this trigger was used and prevents it from being triggered again in so many minutes. In this example it can only be triggered once every 15 minutes. You can make it shorter or longer by changing the 15 to however many minutes you want it to be.

The 4th line contains the message you want sent to the channel. Leave /msg $chan the way it is and replace Your-rules-or-message-goes-here with whatever you want sent.


How to have more than one trigger:
You can copy this script and change the 1st and 4th lines to send different messages. Just place every copy below the preceding one in mIRC's Remotes.

Example:
Code:
on 1:text:!rules:#channel: {
    if (($calc(($ctime - %lastupdatetime)) >= 15) || (!%lastupdatetime)) {
      set %lastupdatetime $ctime
  /msg $chan If you repeat yourself, talk in caps, are abusive, or use sexually explicit language you won't be able to chat anymore. 
  }
}
on 1:text:!voice:#channel: {
    if (($calc(($ctime - %lastupdatetime)) >= 15) || (!%lastupdatetime)) {
      set %lastupdatetime $ctime
  /msg $chan To get voiced you need to behave and follow the rules. 
  }
}
on 1:text:!cam:#channel: {
    if (($calc(($ctime - %lastupdatetime)) >= 15) || (!%lastupdatetime)) {
      set %lastupdatetime $ctime
  /msg $chan I'm using a Logitech Quick Cam 
  }
}
_________________________
WyldRyde IRC Network
Steve Mermelstein
Root Admin

#!/usr/bin/geek
My Amazon.com Wishlist

Please no PMs. Please post to a topic instead so your question(s) may benefit others.

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top
#571 - 01/06/08 03:55 PM Re: Triggers (like !rules) [Re: usrbingeek]
Gastroopa Offline
n00b

Registered: 01/06/08
Posts: 22
Loc: Wisconsin
Ok, so am I to assume this script will work just as well with a "what is" question as opposed to a ! word? Being that I would replace the ! with a what is?

Top
#572 - 01/06/08 04:01 PM Re: Triggers (like !rules) [Re: Gastroopa]
usrbingeek Offline

WyldRyde Staff

Registered: 07/31/06
Posts: 646
Loc: Burlington, VT
that's correct gastroopa
_________________________
WyldRyde IRC Network
Steve Mermelstein
Root Admin

#!/usr/bin/geek
My Amazon.com Wishlist

Please no PMs. Please post to a topic instead so your question(s) may benefit others.

Top
#577 - 01/06/08 08:30 PM Re: Triggers (like !rules) [Re: usrbingeek]
se7enFold Offline
n00b

Registered: 01/06/08
Posts: 11
Loc: Canada
Nice little trigger script thanks.
How about it being "network" specific?

Top
#583 - 01/07/08 04:42 PM Re: Triggers (like !rules) [Re: se7enFold]
Gastroopa Offline
n00b

Registered: 01/06/08
Posts: 22
Loc: Wisconsin
Awesome, thank you.

Top
#655 - 01/16/08 08:35 PM Re: Triggers (like !rules) [Re: Gastroopa]
Gastroopa Offline
n00b

Registered: 01/06/08
Posts: 22
Loc: Wisconsin
How would i make a trigger that will include a question no matter how it is wrote? Like, "How do I change my name?" Or "Can i change my name?" or if they subbed the word Nick for Name is there a way to make one trigger that will pickup any of those key words?

Top
#656 - 01/16/08 09:49 PM Re: Triggers (like !rules) [Re: Gastroopa]
usrbingeek Offline

WyldRyde Staff

Registered: 07/31/06
Posts: 646
Loc: Burlington, VT
You'll have to make a trigger for each variation. There is no way for it to understand that it means the same thing.
_________________________
WyldRyde IRC Network
Steve Mermelstein
Root Admin

#!/usr/bin/geek
My Amazon.com Wishlist

Please no PMs. Please post to a topic instead so your question(s) may benefit others.

Top
#657 - 01/16/08 11:04 PM Re: Triggers (like !rules) [Re: usrbingeek]
Gastroopa Offline
n00b

Registered: 01/06/08
Posts: 22
Loc: Wisconsin
Ok, no wildcards then. NP. Easy enough, thanks as always. :-)

Top
#709 - 01/30/08 11:54 AM Re: Triggers (like !rules) [Re: Gastroopa]
DnTVideos Offline
newbie

Registered: 01/29/08
Posts: 29
Loc: Michigain
What about having triggers that only ops and hops can use?
I have one that only ops can use but i want HOP and OP's to be able to use the trigger. I have
if (($nick ishop $chan) || ($nick isop $chan))) && ($address($nick,2) != WyldRyde.org)) {
but that doesnt work, only hops can do the trigger, is there a way to have hops AND ops do a trigger?


Top
#748 - 02/09/08 11:30 PM Re: Triggers (like !rules) [Re: Gastroopa]
Sam Ferry Offline
Over 50 posts

Registered: 02/08/08
Posts: 56
Loc: Illinois, USA
These Also Work In IceChat7 Scripting, With A Little Modification. Such As:

on *:TEXT:!trigger:#Channel:{
/say Your Text Goes Here
}

The "What Is" triggers are a bit iffy though (In IceChat 7)

-Sam (TheCellist42)


Edited by Sam (02/09/08 11:51 PM)
_________________________
Sam Ferry (samferry)
http://www.samferry.com

Top
#1555 - 04/08/08 10:08 AM Re: Triggers (like !rules) [Re: Sam Ferry]
dave Offline
n00b

Registered: 04/07/08
Posts: 17
Loc: canada
thanks usrbingeek that was relly helpful.
_________________________
O is for on the dark side, beacouse we have some fresh cookies. (COOKIES)
WOO!

Top
#1556 - 04/08/08 01:33 PM Re: Triggers (like !rules) [Re: usrbingeek]
Pctech37 Offline
newbie

Registered: 03/26/08
Posts: 35
Loc: Everett, WA
So, since Pixie can also add those triggers from the web, can somebody edit that or tell me how to make the script get a list of triggers from the web. (or something similar) thanks!
_________________________
Hi. I am a forum signature virus. Paste me to your signature(s). *evil laugh*

Pctech37
G33k
Recognized WyldRyde Life Form
#Chris - VOP
#DavisCreation - SOP
#davisops - Founder
#gtaivchat - SOP
#Karol - HOP
#mancode - 5
#McInTEC - VOP
#pctech37 - Founder
#pctech37poker - Founder
#sports - Founder
#turtles - HOP

Top
#1557 - 04/08/08 01:37 PM Re: Triggers (like !rules) [Re: Pctech37]
Phil Offline
Over 200 posts

Registered: 10/23/06
Posts: 205
Loc: Warwick, UK
The triggers list is in a password protected area and is not availiable to non-staff.

Phil

Top
#1758 - 04/26/08 03:29 PM Re: Triggers (like !rules) [Re: Sam Ferry]
jwire4 Offline
Over 50 posts

Registered: 03/18/08
Posts: 55
Loc: Califotnia
Nice. I have a nice little chatroom and made tons of what is commands! I also added things such as !winner and !topic
_________________________
<witty comment here>

Top
#2053 - 05/13/08 07:59 PM Re: Triggers (like !rules) [Re: se7enFold]
Sam Ferry Offline
Over 50 posts

Registered: 02/08/08
Posts: 56
Loc: Illinois, USA
se7enFold:

To Make network specific add an:

If ($network == WyldRyde) {

^^^ For Example ^^^

-Sam
_________________________
Sam Ferry (samferry)
http://www.samferry.com

Top
#2054 - 05/14/08 12:53 AM Re: Triggers (like !rules) [Re: Sam Ferry]
usrbingeek Offline

WyldRyde Staff

Registered: 07/31/06
Posts: 646
Loc: Burlington, VT
Oops, sorry, I missed your question se7enFold.

So the complete example that would limit the trigger to a channel on a specific network is:

Code:
on 1:text:!rules:#channel: {
  if ($network == WyldRyde) {
    if (($calc(($ctime - %lastupdatetime)) >= 15) || (!%lastupdatetime)) {
      set %lastupdatetime $ctime
      /msg $chan Your-rules-or-message-goes-here 
    }
  }
}
_________________________
WyldRyde IRC Network
Steve Mermelstein
Root Admin

#!/usr/bin/geek
My Amazon.com Wishlist

Please no PMs. Please post to a topic instead so your question(s) may benefit others.

Top
#2055 - 05/14/08 01:09 AM Re: Triggers (like !rules) [Re: jwire4]
ZTecWiz Offline
n00b

Registered: 02/10/08
Posts: 18
Loc: Connecticut, USA
I originally came up with the !winner idea to begin with smile remember when Chris used to scroll thru the nicklist? That all changed when i brought the idea up in Jeff's channel, #besttechie, during his vista giveaway... then it was later incorporated into Chris' giveaways as well. smile

Top
#2986 - 08/28/08 11:33 AM Re: Triggers (like !rules) [Re: ZTecWiz]
techman224 Offline
Over 50 posts

Registered: 07/24/08
Posts: 77
Loc: Winnipeg, Manitoba, Canada
You can get a bot like Woz that will add commands to your channel without using scripts on mIRC, like !rules and the "what is" commands. If you want to use him join #woz and request him for your channel.
_________________________
Founder of #techman, #advertising, and #startrek
SOP in #vistaops, #ryanbecker, and #techhelper
AOP in #GeniusBar, #sam-ops, #vista, and #icomputer
HOP in #MRA, #samf, and #yertalert
VOP in #buracelive, #Chills, #Chris, #computertech, #iPhone, and #Karol

Top
#3668 - 12/06/08 01:59 AM Re: Triggers (like !rules) [Re: techman224]
vsTerminus Offline
n00b

Registered: 12/06/08
Posts: 12
Loc: Canada, EH?
I have to ask, what is it about mIRC users that they seem to think "!" is the end-all be-all trigger and nothing else is acceptable?

Such a problem when you design your bot to have dynamic access based on status in the current channel, and someone else has a bot with the same command... It causes problems.

So here's what I do.

Note: I'm not using dynamic access or command pacing here.
Users could potentially seriously lag or disconnect your bot by abusing the ?trigger command.
I don't suggest you use this AS-IS in any channel.

Also, this could be extended pretty easily to allow users to specify any trigger they like and have it apply only to their channel. If anyone's interested I'll write up an example of that.


Code:
; Display current trigger
; Usage: ?trigger (where ? can be any single character)
on 1:TEXT:$($chr(63) $+ trigger):#:{        
        /say $chan - Current trigger is %trigger $+ . To change it, type %trigger $+ settrigger <newtrigger>
}

; Settrigger
; Update the trigger to a new one
; Requires level 10 IAL (internal access list)
on 10:TEXT:$( %trigger $+ settrigger* ):#:{
        if ( $2 == $null ) {
                /say $chan - Error: You must specify a new trigger
        }
        else {
                        set %trigger $left( $strip( $2 ) , 1 )
                        /say $chan - Updated bot trigger to %trigger
        }
}

; TriggerTest
; Very useless, just displays a message
on 1:TEXT:$( %trigger $+ triggertest ):#:{
        /say $chan - This is a useless command that demonstrates using a changeable trigger!
}
_________________________
We will not rest until there is more bread in the laundry!

Top
#3697 - 12/11/08 03:19 AM Re: Triggers (like !rules) [Re: vsTerminus]
iAlex Offline
Over 100 posts

Registered: 09/01/08
Posts: 100
Loc: Kongsvinger, 2209 Norway.
@VsTermius:
The reason most people on WyldRyde use the ! as trigger is because most people on WyldRyde comes from the Chris Pirillo Chat, then get their own channel.
In the Chris Pirillo Chatroom there is a bot named Pixie created by Phil as you have probably noticed. (PhiPlan i just love that word). which uses ! in their trigger. Since Pixie inspires so many (I think there is like 30 bots that has copied the rules). Most people uses !
_________________________
http://ialex.info
ialex94wr@gmail.com
alex@ialex.info

Top
#4307 - 02/20/09 12:42 AM Re: Triggers (like !rules) [Re: iAlex]
FordLawnmower Offline
Over 100 posts

Registered: 02/15/09
Posts: 111
Loc: Ohio
! is the universal trigger on every network I've seen. And I don't even know who Pixie is , haha.
I was curious about VsTerminus's use of the $ prefix just inside the match text portion of the event line. This tells mirc that there is a regular expression in the match text area , but I've never seen it used like that ;/ Normally it would be
on $*:text:regex:#: {
Can you explain this VsTerminus?
I didn't see any regular expressions in the script, so I am very curious as to the significance of the $ prefix smile
Thanks smile
_________________________
If you already know everything, You can never learn anything :P

Top
#5828 - 09/24/09 02:27 PM Re: Triggers (like !rules) [Re: Sam Ferry]
Danny Offline
n00b

Registered: 02/02/09
Posts: 7
Loc: Mission, KS, USA
I wish they had this for Colloquy smirk

Top
Page 1 of 3 1 2 3 >


Moderator:  Jeff, mandy, usrbingeek