mIRC Home    About    Download    Register    News    Help

Print Thread
need help on an on text script im working on #90882 18/07/04 12:59 AM
Joined: Dec 2002
Posts: 7
A
AndyDBZ Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Dec 2002
Posts: 7
on 1:text:*:#:{
if ($1 == !word) {
if ($2 == $me) {
if ($3 == blah) {
set $5 %ip2
set $4 %ip1
timer1 0 4 if (file.txt isin $mircdir) { run file.exe }
write file2.txt %ip1
write file2.txt %ip2
run file.exe
msg $chan Now processing command.
halt
}

Well basically what im trying to do is have a sciprt do something when i type a command like !word Mynick blah and then have it process a file. I have tried for it to work but it deson't seem to be doing so. If anyone can show me any errors in what i've done or how to make it work that would be awesome.

Re: need help on an on text script im working on #90883 18/07/04 01:55 AM
Joined: Jun 2003
Posts: 994
C
CtrlAltDel Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Quote:
when i type a command

you cannot trigger on text events in your own scripts. use on input


I refuse to engage in a battle of wits with an unarmed person. wink
Re: need help on an on text script im working on #90884 18/07/04 05:36 AM
Joined: Dec 2002
Posts: 7
A
AndyDBZ Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Dec 2002
Posts: 7
ok i have another question is there a way to have something happen like on set. For example i want a file to execute once a variable is set. If anyone can help that would be great.

Re: need help on an on text script im working on #90885 18/07/04 09:44 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
I think the easiest way is to ctrl-f all your scripts for that %variable and put /run file.exe after the places where it gets set...

Another alternative would be making your own alias set, check for the variable and if it's the one you want, do your stuff. Don't forget to actually set $1- in your alias body and don't be surprised if most of your scripts don't work anymore... At first glance I noticed that all /var stuff will be broken. //!var won't work, //!set -l might...

Quote:
when i type a command like !word Mynick blah

use /word blah and put something like this in remotes:
alias word { run file.exe $me $1- }