mIRC Home    About    Download    Register    News    Help

Print Thread
A timer setting. #84125
25/05/04 07:31 PM
25/05/04 07:31 PM
Joined: May 2004
Posts: 17
S
Stium Offline OP
Pikka bird
Stium  Offline OP
Pikka bird
S

Joined: May 2004
Posts: 17
Still new to all the scripting but I'm catching on really fast but I need a quick script on timers

Alright I want to every 30 mintes post a joke in my channel but it goes deeper than that.

I want the joke to pull a name of one of my clan mates and put it in front of the joke.

This could go a lot deeper to read the .roster setting all the names there and post them in front of the jokes randomly.

I dunno, getting over my head with all these scripts.

Re: A timer setting. #84126
25/05/04 07:46 PM
25/05/04 07:46 PM
Joined: May 2004
Posts: 17
S
Stium Offline OP
Pikka bird
Stium  Offline OP
Pikka bird
S

Joined: May 2004
Posts: 17
Can I do it this way?

on *:TEXT:*:#:{
.timer 10 1800 msg # $read($names,jokes.txt)
}

Re: A timer setting. #84127
25/05/04 07:51 PM
25/05/04 07:51 PM
Joined: May 2004
Posts: 17
S
Stium Offline OP
Pikka bird
Stium  Offline OP
Pikka bird
S

Joined: May 2004
Posts: 17
Reposting to my self

msg # $read(names.txt) $read(jokes.txt)

Will work but I've got to get the timer settings down

Re: A timer setting. #84128
25/05/04 07:54 PM
25/05/04 07:54 PM
Joined: Feb 2004
Posts: 714
Brasil
Z
Zyzzyx26 Offline
Hoopy frood
Zyzzyx26  Offline
Hoopy frood
Z

Joined: Feb 2004
Posts: 714
Brasil
if you want a non-stop timer, use /timerName 0 1800 msg # $read(names.txt) $read(jokes.txt)

That will make the timer act every 30 mins forever (until you end it or the client closes)

Hope it does it smile

BTW, you can Edit you own posts wink

Zyzzy.

Last edited by Zyzzyx26; 25/05/04 07:55 PM.

"All we are saying is give peace a chance" -- John Lennon
Re: A timer setting. #84129
25/05/04 07:54 PM
25/05/04 07:54 PM
Joined: May 2004
Posts: 17
S
Stium Offline OP
Pikka bird
Stium  Offline OP
Pikka bird
S

Joined: May 2004
Posts: 17
yes, I was only planing on starting it for 10 times.

Re: A timer setting. #84130
25/05/04 07:56 PM
25/05/04 07:56 PM
Joined: Feb 2004
Posts: 714
Brasil
Z
Zyzzyx26 Offline
Hoopy frood
Zyzzyx26  Offline
Hoopy frood
Z

Joined: Feb 2004
Posts: 714
Brasil
Oic then.. wink


"All we are saying is give peace a chance" -- John Lennon
Re: A timer setting. #84131
25/05/04 08:01 PM
25/05/04 08:01 PM
Joined: May 2004
Posts: 17
S
Stium Offline OP
Pikka bird
Stium  Offline OP
Pikka bird
S

Joined: May 2004
Posts: 17
on *:TEXT:*:#:{
.timer 0 1800 msg %clanchan $read(names.txt) $read(jokes.txt)
}

full script?

Look good?

Re: A timer setting. #84132
25/05/04 09:07 PM
25/05/04 09:07 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
Hi,

you're almost there. But some things have to be changed first.


First and most important:

Do you realise that the current way you have ur script setup, means that ANYTIME anyone says something in any channel that you are in, a new timer will be set. Im sure this is not your intention.

Here's a solution that might suit you better:
Code:

on me:*:JOIN:%clanchan: .timer 0 1800 msg %clanchan $!read(names.txt) $!read(jokes.txt) 

Note 1:
As you can see the ON TEXT event is changed to the ON JOIN event, specifically when you join your channel %clanchan, then the timer starts, and will msg to %clanchan every 1800 seconds a joke with a nick of your clan members in front of it.

Note 2:
Remember, that if you are using a command from the command line with // in front of it, like //.timer .. then the contents of the line will first be evaluated, then executed. This is the same when a command is run from a script. In other words,

on me:*:JOIN:%clanchan: .timer 0 1800 msg %clanchan $read(names.txt) $read(jokes.txt)

will send out the exact same text message every 1800 seconds. That is cuz mIRC first evaluates $read(names.txt) and $read(jokes.txt) and then sets the timer.

In other words, you need for the two $read identifiers to be re-evaluated each time the timer triggers.

Solution:

msg %clanchan $!read(names.txt) $!read(jokes.txt) or msg %clanchan $($read(names.txt) $read(jokes.txt),0)

Both solutions will make sure that the $read identifiers get sent to the timer without having been evaluated yet.

Greetz




Gone.
Re: A timer setting. #84133
25/05/04 10:44 PM
25/05/04 10:44 PM
Joined: May 2004
Posts: 17
S
Stium Offline OP
Pikka bird
Stium  Offline OP
Pikka bird
S

Joined: May 2004
Posts: 17
Great post.

I didn't end up useing it because I did it how a pre posted it and it worked.

I did how ever add what you said to my remote to start when I join the channel I want.

I will try the $! and see.

Re: A timer setting. #84134
26/05/04 04:40 PM
26/05/04 04:40 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
Hi,

to see what I'm referring to, do the following:

//timer 10 1 echo -a $read(names.txt) $read(jokes.txt)

which should show u the same message each time (remember, double // is the same as running from remote, which is the case here in your script)

//timer 10 1 echo -a $!read(names.txt) $!read(jokes.txt)

that should show u a random message each time.

Hope this made things clearer,


Greetz



Gone.