|
Joined: Jul 2006
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2006
Posts: 26 |
Ok, so...im not brilliant with scripting. I only know the basics and would like help for a script, as Im not quite sure how to start it.
Well, I own a channel, (gaming one), and its an adventure game that has fishes to catch aswell. I want a script that can display info on them. I would like it to be possible to add my own fish, and delete them. Once iv'e added a fish, I can search it by its name...like:
-findfish <name>, and it displays info.
When I ADD dish, I want it to be like: -addfish <name> <location> <month> <time> <money>
THEN, I can find them by their name, so I type: -findfish <name>, and it does a $nick message saying: *The name of this fish is <name> *The location of this fish is <location> *The month that this fish appears is in <month> *The time when this fish is catchable is <time> *This fish is worth <money> bells.
Obviously, I want it so I can delete the fish or add them, so people cant just add random ones. Once this is done, Im sure ill be able to edit it for a bug one.
Oh, one last thing, is it possible to install a ommand? I type -fish and it comes up with how to search for them.
[line] Really sorry if this is too much, its my first time here, and im not excellent with scripts either, as I said I only know the basics. Really sorry if this is against the rules or anything, requesting a script.
Very new to mIRC, don't know much.
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
if you want to script it yourself look up
/help token identifiers
you are specifically looking for $gettok(%var,num,32)
32 being a space character ascii code
i.e you set a variable using your -addfish command
-addfish <name> <location> <month> <time> <money>
set %fish $+ $1 $1- returns:
%fish<name> <name> <location> <month> <time> <money>
you can then return each of those with $gettok
for example var %i 0 while %i < $numtok(%fish<name>) { inc %i echo $gettok(%fish<name>,%i,32) }
would return:
<name> <location> <month> <time> <money>
I hope this points you in the right direction..
This is only one way of solving it you could also use hash tables/text files etc.
btk
Last edited by billythekid; 26/07/06 06:31 PM.
billythekid
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
Here's a simple way of doing what you requested. Before running it, you need to add yourself to your bot's userlist with a level of 10. Help (This command can only be used 1 time per every 3 seconds to prevent flooding) -fish Add a fish (Can only be used by users with level 10 or higher) -addfish <name> <location> <month> <time> <money> Remove a fish (Can only be used by users with level 10 or higher) -remfish <name> Find a fish (This command can only be used 1 time per every 5 seconds to prevent flooding) -findfish <name> on *:TEXT:-fish:[color:red]#YourChannelHere[/color]:{
if (%noflood.fishhelp) {
set -u3 %noflood.fishhelp 1
.notice $nick Search syntax: -findfish <name>
}
}
on 10:TEXT:-addfish *:[color:red]#YourChannelHere[/color]:{
if (!$6) {
.notice $nick -fishadd missing parameters.
.notice $nick Syntax: -fishadd <name> <location> <month> <time> <money>
}
else {
writeini fish.ini $2 Location $3
writeini fish.ini $2 Month $4
writeini fish.ini $2 Time $5
writeini fish.ini $2 Money $6
.notice $nick Added $2 to the database.
}
}
on 10:TEXT:-remfish *:[color:red]#YourChannelHere[/color]:{
if ($readini(fish.ini,n,$2,Location)) {
remini fish.ini $2
.notice $nick Removed $2 from the database.
}
else {
.notice $nick No fish named $1
}
}
on *:TEXT:-findfish *:[color:red]#YourChannelHere[/color]:{
if (!%noflood.find) {
if ($readini(fish.ini,n,$2,Location)) {
set -u5 %noflood.find 1
.notice $nick The name of this fish is $2
.notice $nick The location of this fish is $readini(fish.ini,n,$2,Location)
.notice $nick The month that this fish appears is in $readini(fish.ini,n,$2,Month)
.notice $nick The time when this fish is catchable is $readini(fish.ini,n,$2,Time)
.notice $nick This fish is worth $readini(fish.ini,n,$2,Money) bells.
}
}
}
|
|
|
|
Joined: Jul 2006
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2006
Posts: 26 |
Thanks! What is level 10 and how do I become it? See, so far I have only used simple calc, spy, 8ball scripts and so on, I havent encountered that before.
Would someone not mind explaining it to me?
Very new to mIRC, don't know much.
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
On your bot's instance of mIRC, type the following command to add yourself with level 10:
//auser 10 $address(YourNickHere,2)
Fill in your nick and also note the double slash as it is necessary for the command to work properly.
By using an user level, you can control who can and who can't use different commands.
For more information, have a look through mIRC's help file.
/help levels
|
|
|
|
Joined: Jul 2006
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2006
Posts: 26 |
Thanks schaefer! Ugh, I cant get on mIRC till Monday! Nooooo!
Very new to mIRC, don't know much.
|
|
|
|
Joined: Jul 2006
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2006
Posts: 26 |
One more question, how do I make it so I can do it on multiple channels?
Very new to mIRC, don't know much.
|
|
|
|
|