www.IRC-Junkie.org Forum Index
Scripting help: Trigger text

?
Post new topic???Reply to topic ???www.IRC-Junkie.org Forum Index -> General IRC Chat
View previous topic :: View next topic ?
Author Message
Shotif



Joined: 06 Oct 2005
Posts: 3

PostPosted: Thu Oct 06, 2005 8:27 pm?? ?Post subject: Scripting help: Trigger text Reply with quote

What I need is a script that lets you assign some text to a trigger command...

for example:

!addtrigger #channel !trigger This is a trigger.

would display the text 'This is a trigger' after someone types !trigger

The script would be on a bot client and the user would be adding the tekst from his own client.

I would appreciate if someone could post the code for such a script here, or give me a link if one already exists. Thank you Very Happy
Back to top
View user's profile Send private message



vakuum



Joined: 01 Nov 2004
Posts: 10

PostPosted: Fri Oct 07, 2005 6:31 pm?? ?Post subject: Reply with quote

It helps if you state what client you want the script for..
Back to top
View user's profile Send private message
Shotif



Joined: 06 Oct 2005
Posts: 3

PostPosted: Mon Oct 10, 2005 12:02 am?? ?Post subject: Reply with quote

Oh sry, forgot to mention...

mIRC 6.16.
I already have Scoopscript 2004 installed on it, if it helps Very Happy

Thankx Wink
Back to top
View user's profile Send private message
Asmo
Site Admin


Joined: 26 Oct 2004
Posts: 675
Location: Undernet

PostPosted: Mon Oct 10, 2005 8:28 am?? ?Post subject: Reply with quote

!addtrigger #channel !trigger This is a trigger.

I dont have any mIRC installed right now, so I can not test this myself, to be sure do a "/help on" and read the ON TEXT part to make sure I got the syntax correct.

Code:

on *:TEXT:!addtrigger:#channel: { msg #channel This is a trigger? }


Gosh, about a year or so ago I last made soemthing in mIRC, and I already feel insecure wether this above works or not, lol.
_________________
Asmo

webmaster www.IRC-Junkie.org
Back to top
View user's profile Send private message Visit poster's website
Shotif



Joined: 06 Oct 2005
Posts: 3

PostPosted: Thu Oct 13, 2005 9:42 am?? ?Post subject: Reply with quote

Maybe it's me but this doesn't work...
Also, I suppose there should be used some kind of variables.

For example:

User enters /msg bot !addtrigger #chan1 !hello 'Welcome to this channel!'

Now, the script on the bot client named 'bot' (Very Happy) gets initialised with the !addtrigger command and sets the following variables:
%channelscr to #chan1
%triggcommand to !hello
%trigtext to 'Welcome to this channel!'

Now, I don't know anything about mIRC scripting, as you might notice, but I'm using my programming knowledge from C++ and Pascal to assume what is neccessary. Also, the 3 variables should be some kind of arrays, so youn can enter a high number of different trigger texts...

Anyway, thanks for your help!
Back to top
View user's profile Send private message
Neo



Joined: 26 Oct 2005
Posts: 7
Location: Holland

PostPosted: Wed Oct 26, 2005 2:58 pm?? ?Post subject: Reply with quote

Code:

on *:text:*:*: {
? if ($1 == !addtrigger) {
? ? /write trigger.txt $2-
? ? msg # trigger ( $+ $2 $+ ) added
? }
? if (! isin $1) && ($1 != !addtrigger) {
? ? set %text $1
? ? set %trigger $remove($read(trigger.txt, s,? %text),$1)
? ? msg # %trigger
? }
}

on 1:input:*: {
? if ($1 == !cleartrigger) {
? ? /write -c trigger.txt
? }
}


!addtrigger #channel !trigger This is a trigger.
sorry.. didn't do the channel part.. but it should work this way.. in all channels where you are...
this worked @ me.. so i hope it works @ you Smile

ps: thanks for this idea :p

edit: added another little peace.. allowing you to clear the trigger list.
if the script should be in a bot.. it might be usefull to give yourself a access in the bot..
add the following line to users (@ the bot):
Code:

100:!*@

and remove the input part and replace that for:
Code:

on 100:TEXT:*:*: {
? if ($1 == !cleartrigger) {
? ? /write -c trigger.txt
? }
}

_________________
my site

you want a banner? contact me.
Neo@deluccio.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Neo



Joined: 26 Oct 2005
Posts: 7
Location: Holland

PostPosted: Wed Oct 26, 2005 3:11 pm?? ?Post subject: Reply with quote

Asmo wrote:
!addtrigger #channel !trigger This is a trigger.
Code:

on *:TEXT:!addtrigger:#channel: { msg #channel This is a trigger? }

Gosh, about a year or so ago I last made soemthing in mIRC, and I already feel insecure wether this above works or not, lol.


it will work but;

!addtrigger
this is a trigger

I don't think that's what shotif was trying to achieve..
because the only way you can add another trigger, is to duplicate and change the on *:text:.. code.
_________________
my site

you want a banner? contact me.
Neo@deluccio.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Asmo
Site Admin


Joined: 26 Oct 2004
Posts: 675
Location: Undernet

PostPosted: Wed Oct 26, 2005 3:33 pm?? ?Post subject: Reply with quote

OK I misunderstood what he needed then ...

It triggers a responce however :p
_________________
Asmo

webmaster www.IRC-Junkie.org
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous: ??
Post new topic???Reply to topic ???www.IRC-Junkie.org Forum Index -> General IRC Chat All times are GMT + 1 Hour
Page 1 of 1

?
Jump to:??
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB ? 2001, 2002 phpBB Group

Loans | Video Game Rental | Remortgage | Chicago Hotel | New York City Hotel