| View previous topic :: View next topic ? |
| Author |
Message |
Shotif
Joined: 06 Oct 2005
Posts: 3
|
Posted: Thu Oct 06, 2005 8:27 pm?? ?Post subject: Scripting help: Trigger text
|
 |
|
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
|
|
| Back to top |
|
|
vakuum
Joined: 01 Nov 2004
Posts: 10
|
Posted: Fri Oct 07, 2005 6:31 pm?? ?Post subject:
|
 |
|
|
It helps if you state what client you want the script for..
|
|
| Back to top |
|
|
Shotif
Joined: 06 Oct 2005
Posts: 3
|
Posted: Mon Oct 10, 2005 12:02 am?? ?Post subject:
|
 |
|
Oh sry, forgot to mention...
mIRC 6.16.
I already have Scoopscript 2004 installed on it, if it helps 
Thankx
|
|
| Back to top |
|
|
Asmo
Site Admin
Joined: 26 Oct 2004
Posts: 675
Location: Undernet
|
Posted: Mon Oct 10, 2005 8:28 am?? ?Post subject:
|
 |
|
!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 |
|
|
Shotif
Joined: 06 Oct 2005
Posts: 3
|
Posted: Thu Oct 13, 2005 9:42 am?? ?Post subject:
|
 |
|
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' ( ) 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 |
|
|
Neo
Joined: 26 Oct 2005
Posts: 7
Location: Holland
|
Posted: Wed Oct 26, 2005 2:58 pm?? ?Post subject:
|
 |
|
| 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 
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):
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 |
|
|
Neo
Joined: 26 Oct 2005
Posts: 7
Location: Holland
|
Posted: Wed Oct 26, 2005 3:11 pm?? ?Post subject:
|
 |
|
| 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 |
|
|
Asmo
Site Admin
Joined: 26 Oct 2004
Posts: 675
Location: Undernet
|
Posted: Wed Oct 26, 2005 3:33 pm?? ?Post subject:
|
 |
|
OK I misunderstood what he needed then ...
It triggers a responce however :p
_________________
Asmo
webmaster www.IRC-Junkie.org
|
|
| Back to top |
|
|
|
|