|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
Hello i`m new here and i need a script what whil make a list If some people do !add <nick> <rank> that it will be added to the list that will be stored on my computer and if they type !open the list will be viewed and if they type !remove <nick> <rank> They nick and rank will be removed from the list... i tried to make this but it didnt worked.... i hope some of you guys can make this I would apriciate that Greetz Dracoz
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Hey Dracoz, just something off the fly. If you find any bugs report back. No doubt it can be more improved but I was in a rush to get it done..
On *:Text:!rank *:#: {
if ($2 == add) && ($4 isnum) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
write ranks.txt $3 $4
msg $chan Updated rank for $3 Ranked: $4
}
else {
write ranks.txt $3 $4
msg $chan Rank added for $3 Ranked: $4
}
}
if ($2 == rem) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
msg $chan Removed rank for $+($3,.)
}
else {
msg $chan $3 has not been ranked thus far..
}
}
if ($2 == open) {
if ($isfile(ranks.txt)) run notepad.exe ranks.txt
}
}
!rank add <nick> <rank> - Adds <nick> with rank <rank> if they're already ranked it'll message the channel saying updated. !rank rem <nick> - Removes rank for <nick>. If <nick> hasn't been ranked it'll message the channel saying <nick> has not been ranked thus far.. !rank open - Opens the file ranks.txt in notepad. I'm sure you can edit the above code to suit your needs a bit more. -Andy
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
hmmm now when i`m on a channel and the bot is in the channel when someone types !rank add <nick> <rank> it doenst write to ranks.txt... :S and when someone types !rank open it doesnt open the rank.txt and tells it to the eprson who types !rank open...
So i dont know why but this doesnt work :S
By the way the ranks are es, db, picci, sl, pp, thief, asso, mob, soldier, swind, assa, lc, chief, brug, --------------- and the idea whas when someone types !targets <rank> then the bots says all the targets from that rank in the channel ---------- !remove typ !remove <user> if the user is dead... ------ !add typ !add <user> <rank> to add a user
I`m trying to make this but it wont work :S
Greetz Dracoz
Last edited by Dracoz; 09/05/05 04:48 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
My bad I assumed the ranks would be numeric.
Try changing ($4 isnum) to ($4)
-Andy
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
Already changed that but when someone types !rank add <nick> <rank> the bot wont write it to a file :S So does anyone know how it will work
Last edited by Dracoz; 09/05/05 05:32 PM.
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
I tried everything but the script doesnt work it even dont gifes an message if someone types !rank add <nick> <rank> Do you know how this will work or can you make a new 1 When this are the rank codes !codes :
Rank codes are : es, db, picci, sl, pp, thief, asso, mob, soldier, swind, assa, lc, chief, brug, and !add
typ !add <user> <rank> to add a target
!remove
typ !remove <user> if the user is dead
!target
typ !target <rank> and you get a list with targets
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Works for me dude.
<Andy> !rank add Andy chief <SK> Rank added for Andy Ranked: chief <Andy> !rank add Andy asso <SK> Updated rank for Andy Ranked: asso <Andy> !rank rem Andy <SK> Removed rank for Andy. <Andy> !rank rem Andy <SK> Andy has not been ranked thus far..
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
Hmmm so this is right ? On *:Text:!rank *:#: {
if ($2 == add) && ($4 isnum) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
write ranks.txt $3 $4
msg $chan Updated rank for $3 Ranked: $4
}
else {
write ranks.txt $3 $4
msg $chan Rank added for $3 Ranked: $4}
}
if ($2 == rem) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
msg $chan Removed rank for $+($3,.)
}
else {
msg $chan $3 has not been ranked thus far..
}
}
if ($2 == open) {
if ($isfile(ranks.txt)) run notepad.exe ranks.txt
}
} Hmm doesnt work here aah i`m freaking out why it doenst work :S It needs to be in remote right?
Last edited by Dracoz; 09/05/05 06:10 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
No, remember I assumed you was using numeric ranks rather than alpha? You can use ($4 isalpha) or just ($4). Below I've used isalpha.
On *:Text:!rank *:#: {
if ($2 == add) && ($4 [color:red]isalpha[/color]) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
write ranks.txt $3 $4
msg $chan Updated rank for $3 Ranked: $4
}
else {
write ranks.txt $3 $4
msg $chan Rank added for $3 Ranked: $4}
}
if ($2 == rem) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
msg $chan Removed rank for $+($3,.)
}
else {
msg $chan $3 has not been ranked thus far..
}
}
if ($2 == open) {
if ($isfile(ranks.txt)) run notepad.exe ranks.txt
}
}
-Andy
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
Hmm ok it work now but when i type !rank open it doenst work ?
Last edited by Dracoz; 09/05/05 06:29 PM.
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
Andy it work now but with 2 problems... !rank rem <nick> doesnt work and !rank open doesnt work
Could you make an extra script when someone says !targets that the names in the file will be spammed on the server :P
Thnx Dracoz
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
The rem and open functions seems to work for me.
On *:Text:!rank *:#: {
if ($2 == add) && ($4) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
write ranks.txt $3 $4
msg $chan Updated rank for $3 Ranked: $4
}
else {
write ranks.txt $3 $4
msg $chan Rank added for $3 Ranked: $4
}
}
if ($2 == rem) {
if ($read(ranks.txt,w,$+(*,$3,*))) {
write $+(-d,$readn) ranks.txt
msg $chan Removed rank for $+($3,.)
}
else {
msg $chan $3 has not been ranked thus far..
}
}
if ($2 == open) {
if ($isfile(ranks.txt)) run notepad.exe ranks.txt
}
if ($2 == targets) {
var %x = $lines(ranks.txt), %target
while (%x) {
var %target = $addtok(%target,$gettok($read(ranks.txt,%x),1,32),44)
dec %x
}
msg $chan Users with ranks: %target
}
}
*Added !rank targets instead of creating another on text event. It wont spam all the users on seperate lines it'll look like this on one line: Users with ranks: Andy,SK,Dracoz etc. -Andy
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 74 |
Hmm it needs to be a KILLIST :P so when someone types !rank targets LC all lc comes there etc etc and when someone types !rank target <rank> there is only coming this [21:05] <@Targets> Users with ranks: while there is an <rank> in the file how can this be :S? could it not be that if someone types !targets ALL users in the file ranks.txt will be sayd to #channel ?
|
|
|
|
|