mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: Need help with this. [Re: powerade661] #253804 07/07/15 09:46 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Originally Posted By: Help Files
To see a list of active timers type /timers. To see the setting for timer1 type /timer1. To deactivate timer1 type /timer1 off. To deactivate all timers type /timers off. If you are activating a new timer you do not need to specify the timer number, just use:

/timer 10 20 /ame I am not here!

And mIRC will allocate the first free timer it finds to this command.
Was all I said. You can find all info you've asked for in this channel by simply reading the help files. Here, I'll go out of my way to explain what Sakana posted since you asked what was going on in his code.

You have this code presented:
Code:
if ($nick == $remove(#,$chr(35))) { return }

If I don't know what the code would do, I would first type " /help /return " and see that this halts a command.
We know that $nick means the username's nickname
We know that $remove will remove something from a string. Our string in this case is #, which is translated to #CHANNEL.
$chr might be an odd one. " /help $chr " - We now know that it returns an ascii character. The ascii character for number 35 is a hashtag (#).

So it literally translates to this.
$nick = Nillens
# = #Nillens
$chr(35) = #
$remove(#,$chr(35)) = Nillens
if (Nillens == Nillens) { return }


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Need help with this. [Re: Nillen] #253807 07/07/15 01:32 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
When I type /timers it shows .timer username 0 1800s delay "the message is here" I know how to stop and create a timer, I just didn't understand what timer was in use so I could stop it.. I learned how to create timers from the help files...

Last edited by powerade661; 07/07/15 01:32 PM.
Re: Need help with this. [Re: powerade661] #253808 07/07/15 01:51 PM
Joined: May 2015
Posts: 249
splinny Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Create timer with NON-default name..


Dont give a fish - teach to fish!
Re: Need help with this. [Re: splinny] #253809 07/07/15 02:54 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
How? .timer.thisismytimer Is that what you are referring to?

Re: Need help with this. [Re: powerade661] #253810 07/07/15 03:09 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You can use

if ($timer(timer_name)) { timer_name off }

/timers <- show you the timers that are running.

Try not to use to many timers since it can make your script slow.

;--- edit

you can name your timers to what you want.

timer.time
timer.show
timer_time
timer_show

Last edited by sparta; 07/07/15 03:10 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Need help with this. [Re: sparta] #253811 07/07/15 03:12 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
My only concern with that was if I name the timer would I be able to run different messages with that timer on multiple channels?

Re: Need help with this. [Re: powerade661] #253812 07/07/15 05:41 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Of course you can. How about creating a timer for each channel? How about creating a timer that calls an alias that messages each different channel?

Examples:
Code:
on 1:join:#: { 
if ($nick == $me) timerMsg_ $+ # 0 600 msg # However you get the message here is up to you I guess.
}

Code:
on 1:connect: {
if (twitch isin $server) timerMsgAll 0 600 msgall 
}
alias msgall { 
var %channels $ini(MSGALL.ini,Chans,0) 
var %i 1 
while (%i <= %chans) {
var %chan $ini(MSGALL.ini,Chans,%i) 
var %message $readini(MSGALL.ini,Chans,%chan)
if (%chan ischan) msg %chan %message
inc %i
}
}
Well, you can always start the same scripts using a different event though if you prefer using text events.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Need help with this. [Re: powerade661] #254075 21/07/15 06:49 AM
Joined: Apr 2014
Posts: 33
B
bl968 Offline
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
I don't know why people still use ini's. I use hashtables for a multichannel twitch bot with extensive features.

/hmake tablename
/hadd tablename itemname value
/hdel tablename itemname

You use $hfind to search it. $hget to check a value.

For each channel I have one table for Channel Data, One for dynamic triggers, One for dictionary terms, one for ops, one for user info commands, one for dynamic trigger aliases, one to store regular users, one to store channel followers, one to store subscribers.

Re: Need help with this. [Re: bl968] #254080 21/07/15 08:37 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Personal preference. In this situation I'd use a local variable over anything, I just used $ini in hopes of educating the user a bit further. I use a variation of inis and hashtables, I don't think there's one better than the other, I think they have unique qualities that trump the other's same aspect.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Page 2 of 2 1 2