|
Joined: Jan 2005
Posts: 17
Pikka bird
|
OP
Pikka bird
Joined: Jan 2005
Posts: 17 |
hi I have a remote script that begins: 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
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
on *:TEXT:$(%myvar):*: do things
Then set %myvar to for example: *view*, *whatever*
Greets
Gone.
|
|
|
|
Joined: Jan 2005
Posts: 17
Pikka bird
|
OP
Pikka bird
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
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
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.
|
|
|
|
Joined: Nov 2004
Posts: 332
Fjord artisan
|
Fjord artisan
Joined: Nov 2004
Posts: 332 |
nifty with the use of the variable as a parameter 
The Kodokan will move you, one way or another.
|
|
|
|
Joined: Nov 2004
Posts: 332
Fjord artisan
|
Fjord artisan
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.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
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.
|
|
|
|
Joined: Nov 2004
Posts: 332
Fjord artisan
|
Fjord artisan
Joined: Nov 2004
Posts: 332 |
gotcha  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.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
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.
|
|
|
|
Joined: Nov 2004
Posts: 332
Fjord artisan
|
Fjord artisan
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.
|
|
|
|
Joined: Jan 2005
Posts: 17
Pikka bird
|
OP
Pikka bird
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 
|
|
|
|
Joined: Nov 2004
Posts: 332
Fjord artisan
|
Fjord artisan
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 
Last edited by ricky_knuckles; 20/01/05 12:47 AM.
The Kodokan will move you, one way or another.
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
on *:TEXT:$($read(myfile.txt)):
as mentioned earlier should do that then
$maybe
|
|
|
|
Joined: Aug 2003
Posts: 314
Fjord artisan
|
Fjord artisan
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
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
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.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
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
|
|
|
|
|