mIRC Home    About    Download    Register    News    Help

Page 2 of 2 < 1 2
Topic Options
#253804 - 07/07/15 10:46 AM Re: Need help with this. [Re: powerade661]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#253807 - 07/07/15 02:32 PM Re: Need help with this. [Re: Nillen]
powerade661 Offline
Vogon poet

Registered: 27/01/15
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...


Edited by powerade661 (07/07/15 02:32 PM)

Top
#253808 - 07/07/15 02:51 PM Re: Need help with this. [Re: powerade661]
splinny Offline
Fjord artisan

Registered: 14/05/15
Posts: 249
Create timer with NON-default name..
_________________________
Dont give a fish - teach to fish!

Top
#253809 - 07/07/15 03:54 PM Re: Need help with this. [Re: splinny]
powerade661 Offline
Vogon poet

Registered: 27/01/15
Posts: 168
How? .timer.thisismytimer Is that what you are referring to?

Top
#253810 - 07/07/15 04:09 PM Re: Need help with this. [Re: powerade661]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
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


Edited by sparta (07/07/15 04:10 PM)
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#253811 - 07/07/15 04:12 PM Re: Need help with this. [Re: sparta]
powerade661 Offline
Vogon poet

Registered: 27/01/15
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?

Top
#253812 - 07/07/15 06:41 PM Re: Need help with this. [Re: powerade661]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#254075 - 21/07/15 07:49 AM Re: Need help with this. [Re: powerade661]
bl968 Offline
Ameglian cow

Registered: 15/04/14
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.

Top
#254080 - 21/07/15 09:37 AM Re: Need help with this. [Re: bl968]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
Page 2 of 2 < 1 2