mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2005
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Dec 2005
Posts: 5
well I'm making a bot. I want there to be a file in this format:

user1 userlevel1
user2 userlevel2
user3 userlevel3
etc....

I need it to automatically set a mode on the user depending on that user's "userlevel" in the file.

I know of the common way to read files, but that chooses one line randomly to read.

is there arrays in mIRC? if so, I need each line to be loaded into an array.

Then it has to set the userlevel as long as that user is in a same channel as the bot automatically.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In this case I'm going to suggest using the search option
eg:
Code:
on *:join:#:{
echo -a $nick $iif($read(levels.txt,s,$nick),has a level of $read(levels.txt,s,$nick),doesn't have a custom level)
} 


You don't specify what modes you want set on what levels, so the above will show you the nick of the person that joined and their level (if applicable)

Just make a text file called levels.txt and format it as you specified in your request.

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
You don't want to read files twice, use
echo -a $nick $iif($read(levels.txt,s,$nick),has a level of $v1,doesn't have a custom level)

btw theguy0000, you know that mIRC has a built-in userlist? Just type /help User List to see some info about it.
mIRc has no arrays, but hash tables are the closest thing. Or just use the read options like RusselB.


Link Copied to Clipboard