mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2014
Posts: 3
O
Self-satisified door
OP Offline
Self-satisified door
O
Joined: Aug 2014
Posts: 3
So i was writting a point system where users getting points for being in the chat (twitch) and use them for minigames and stuff.
I saw many people using the /timer method where the script creates a unique timer for every user who joins the chat under a "on join" command and add some points to the user every few min according to the time delay.

What i wrote is a while command, that loops entire users ini file and add points to every user inside ini file every few min.

So my question is which one is lighter for mirc? For example if there are 200 viewers in the chat, mirc will create 200 unique timers for every user and run each one untill someone part.

With while method, mirc will loop 200 entries inside ini file with one timer every few min. Is 2nd method better than the 1st or it doesn't matter at all?
Thanks in advance wink

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
What you're describing are two completely different things. Looping over an ini file's contents will definitely take longer due to the fact that once a user is in it, he will not get out of it, and if you have 200 users one day, and 200 other users join the next day, you'll have a total of 400 users in the ini to loop over.
What you'd be looking for instead is looping over all users in the channel and adding that to your ini file.

As for what takes up most resources, I can't imagine either being vastly better than the other. Don't quote me though, I don't have any experience or research regarding that matter.

The most efficient way however would be to use a hashtable over an ini file for storing, and I personally would use the while loop for users in $chan.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard