mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
I can't find solution for that:

Now i make a bot, and one of his command is: !weapon

I have a directory: /weapons/
Those content:

knife.txt - ID 1
pistol.txt - ID 2
fork.txt - ID 3

The ID is on the line 15

If someone writes !weapon 2 need to check all files in the /weapons/ directory..
And if find the ID then set %find_id 2 set %murder pistol

And then i will check
if ($1 == %find_id) { msg $nick the murder is: %murder and the murder's id is %find_id
} else { msg $nick can't find murder..
}


[color:red]m[color:blue]IRC[color:green] for EvEr

Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
hmm. I think its right:
set %i 1
set %i_id $1
while (%i <= %i_id) {
set %i_id $+($read($findfile(weapons/,*.txt,%i),15))
set %find $+($read($findfile(weapons/,*.txt,%i),14))
inc %i
}
if ($1 == %i_id) {
msg $nick %i_id = %find
}


[color:red]m[color:blue]IRC[color:green] for EvEr


Link Copied to Clipboard