mIRC Home    About    Download    Register    News    Help

Print Thread
auto altering a script #108450 19/01/05 07:16 PM
Joined: Jan 2005
Posts: 17
S
severnaya Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jan 2005
Posts: 17
hi
I have a remote script that begins:
Code:
on 1:TEXT:*view*:*: { 


however, I want the text 'view' to be changed after X minutes, so that the command changes periodically..
is it possible to do this, or is it beyond the scope of mirc scripting?
hope u can help
thanx

Re: auto altering a script #108451 19/01/05 07:18 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
on *:TEXT:$(%myvar):*: do things

Then set %myvar to for example: *view*, *whatever*

Greets


Gone.
Re: auto altering a script #108452 19/01/05 07:23 PM
Joined: Jan 2005
Posts: 17
S
severnaya Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jan 2005
Posts: 17
thanx, so - if I declared %myvar, how would I make the value of %myvar change its value from a list every so often?
thanks again

Re: auto altering a script #108453 19/01/05 07:36 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Well use a timer.

//timer 0 600 changevar

Will call an alias called "changevar" every 600 seconds, and keep running forever till you stop it manually or close mirc.

alias changevar {
; your if conditions to chose when you want to set what variable
if (blah) { set %myvar *views* }
elseif (bleh) { set %myvar *whatever* }
}

This is really a bit strange though, like, how do you expect your script to know what var it should set at what time? It's really more of a manual thing that you should set.

I can't help you further unless you specify under what conditions you want what as matchtext. Btw in mIRC /help /timer

You mentioned a list...what kind of list, where is this list, how should the script choose what from the list, what are the criteria? Should it be random? May it be the same value 2 times in a row, etc etc etc.

Be as specific as can be please.

Greets


Gone.
Re: auto altering a script #108454 19/01/05 07:49 PM
Joined: Nov 2004
Posts: 332
R
ricky_knuckles Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
nifty with the use of the variable as a parameter
smile


The Kodokan will move you, one way or another.
Re: auto altering a script #108455 19/01/05 07:53 PM
Joined: Nov 2004
Posts: 332
R
ricky_knuckles Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
a list?
could he maybe make a txt and change
the on text using $read in some way
im still trying to wrap my mind around your example optics
$(%myvar)
?
still dont quite understand how it works


The Kodokan will move you, one way or another.
Re: auto altering a script #108456 19/01/05 08:08 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Well, as you know you cannot put anything that needs evaluation directly into the matchtext. So you need to use $() to ensure evaluation.

So whatever you put between $() will first be evaluated rather than to match the actual variable text.

on *:TEXT:%myvar: will match on the actual word "%myvar" while if you $eval it like

on *:TEXT:$(%myvar): %myvar first evaluates to whatever value it holds, and then mIRC compares it to see if there is a match or not.

You can put identifiers in there as well:

on *:TEXT:$($+(*,$me,*)):#: echo -a Someone mentioned your nick

Greets


Gone.
Re: auto altering a script #108457 19/01/05 08:10 PM
Joined: Nov 2004
Posts: 332
R
ricky_knuckles Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
gotcha wink
thanks for the liquid clarity
what about using $read in the same fashion so he can have a random text trigger from a .txt


The Kodokan will move you, one way or another.
Re: auto altering a script #108458 19/01/05 08:23 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Yeah you can put a read in there like:

on *:TEXT:$($read(myfile.txt,n)):

But that doesn't work as he wants it to. $read returns a random line, so it would be a different matchtext with every time the on text is triggered, while he wants to have a certain word to trigger for a while, and then switch to another word.

Greets


Gone.
Re: auto altering a script #108459 19/01/05 11:02 PM
Joined: Nov 2004
Posts: 332
R
ricky_knuckles Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
well i dont know but i know u can use play -t
to go through a section ina txt
but i dont know that you can implement it the way he would like


The Kodokan will move you, one way or another.
Re: auto altering a script #108460 19/01/05 11:06 PM
Joined: Jan 2005
Posts: 17
S
severnaya Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jan 2005
Posts: 17
hi
by a list I meant either a txt file with different triggers per line, or some sort of arraylist of different trigger words. they should be selected at random, and it doesnt matter if the same ones are selected in a row..
thanks 4 your help, I will work on it
ps: I am a she not a he wink

Re: auto altering a script #108461 20/01/05 12:46 AM
Joined: Nov 2004
Posts: 332
R
ricky_knuckles Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
excuse me ma'am it wont happen again
in any case this thread along with /help $read
should give you pretty much everything you need wink

Last edited by ricky_knuckles; 20/01/05 12:47 AM.

The Kodokan will move you, one way or another.
Re: auto altering a script #108462 20/01/05 09:31 AM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
on *:TEXT:$($read(myfile.txt)):

as mentioned earlier should do that then


$maybe
Re: auto altering a script #108463 20/01/05 10:05 AM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Actually a variable on its own in matchtext is evaluated, similar to including a variable in the target section of the header

Re: auto altering a script #108464 20/01/05 12:15 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Indeed, if it's only a variable with nothing else, then it evaluates the variable, odd that I forgot that.

In the case of a mix of regular words and variables, the eval is needed like:

on *:TEXT:!kick %hehe:#: would trigger on !kick %hehe

whereas $(!kick %hehe):#: would trigger on !kick <value of %hehe>

Cya


Gone.
Re: auto altering a script #108465 20/01/05 09:46 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I would suggest as you did that everyone use $(!kick %hehe):#: even if its is $(%hehe):#: better to keep regular coding practices than be jumping back and forth, cause u know one day your gonna change :%hehe:#: to :!kick %hehe:#: and then curse for half an hour tell you spot why it wont trigger