Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I need to know.. (https://forums.graalonline.com/forums/showthread.php?t=13484)

10-01-2001 04:15 AM

I need to know..
 
How would i remove a account name from server.jail
Like if their is server.jail= Joe james roe and i say Unjail Player Joe
it will remove their accountname out of server.jail=
thanks for helping...

IceHawk 10-01-2001 04:18 AM

I can't understand that

Vinvect 10-01-2001 04:30 AM

he means how to do leik
if a person's account name is:
CoolDude
then u say this
unjail CoolDude
thats wut he means

Dean 10-01-2001 04:38 AM

dunno
 
beats me?

10-01-2001 05:04 AM

Whoever tells me the script, i will give like 20-25 gralts on graal.

Metal-Slug 10-01-2001 05:11 AM

Quote:

Originally posted by Kaimetsu
IcePick, you should clear your PM box again. Even the sent items.
hey, kame, can you shrink yourself into a pocket size so i can use you? i need allot help about,, now

10-01-2001 05:25 AM

Quote:

Originally posted by Kaimetsu
IcePick, you should clear your PM box again. Even the sent items.
Okay i did, But can you help me with this script? I really really need it bad!

10-01-2001 05:41 AM

Quote:

Originally posted by Kaimetsu


Ack. I'll point you in the right direction:

Use indexof to find where the name to be removed is in the list. Then use #e to isolate the chunk in front of it and the chunk behind it and do:

setstring server.jail,#e(informationforstuffinfront) #e(informationforstuffbehind);

I'll help more if you get stuck, but if you do request more help then post what commands.rtf says about #e and indexof at the same time because I've forgotten the syntaxes and I ca't be bothered going to my Graal folder.

Ok I am stuck, I will talk to you in pm, so read your pm...

10-01-2001 05:53 AM

Message board pm that is, not on graal.

10-01-2001 05:56 AM

#e(startindex,length,string) extracts a substring out of ‘string’ (length=-1 -> till the end)


indexof( partstr, str ) position of where partstr appears in str (-1 -> not in str)

10-01-2001 06:08 AM

okay from what you said in the pm, you will help me on here....

I dont understand what goes in the ()...


Is the first one (server.jail)?

ArmadeusWarlock 10-01-2001 06:14 AM

lol
 
OMG this is so easy its not even funny.
Also, I would tell you but I already made a script like this for my server so Ill just leave you be

10-01-2001 06:26 AM

Quote:

Originally posted by Kaimetsu


We'll assume that the name to be removed is stored in the string "namestring".

startofname=indexof(#s(namestring),#s(server.jail) );
setstring server.jail,#e(0,startofname,server.jail)#e(starto fname+len(namestring),-1,server.jail);

That should do it, though it may grab one character too few or many. Test it and see what happens.

So this is the hole script?

setstring server.jail,#e(0,startofname,server.jail)#e(starto fname+len(namestring),-1,server.jail);

10-01-2001 06:30 AM

Wait i mean this is the hole script?

PHP Code:

if (playerchats && startswith(Unjail Player,#c)) {
  
setstring server.jail,#e(0,indexof(#s(namestring),#s(server.jail)); ,server.jail)#e(indexof(#s(namestring),#s(server.jail)); +len(namestring),-1,server.jail);



btedji 10-01-2001 09:11 AM

Re: lol
 
Quote:

Originally posted by ArmadeusWarlock
OMG this is so easy its not even funny.
Also, I would tell you but I already made a script like this for my server so Ill just leave you be

haha this is easy

10-01-2001 05:49 PM

Come on someone tell me...

toad1413 10-01-2001 06:12 PM

Re: Re: lol
 
Quote:

Originally posted by btedji


haha this is easy

Then tell him how to do it if you think it's that easy.

I would help, but I don't know how to do that stuff yet. :)

toad1413 10-01-2001 07:42 PM

Quote:

Originally posted by Kaimetsu


Forget it, this is taking up far too much of my time and patience. Try some basic things first until you get good enough to move onto stuff like this.

Heh. I can't do that, mainly because I wouldn't ahve a clue what #e is for, and teh fact that I haven't ever done any work with stings before doesn't help. :)

Oh, and Kai, go on icq if possible.

10-02-2001 03:11 AM

Come on someone please help me :*(

btedji 10-02-2001 03:17 AM

i'll make you one, just give me a couple minutes

Falcor 10-02-2001 03:18 AM

Look at Aces tutorial a REALLY long time
The go to the commands.RTF and look at that.

btedji 10-02-2001 03:31 AM

here ya go:

NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}



this works, but you'll have to add testing to see if the player name is actually in the string or else if it doesnt it will mess up the string

10-02-2001 03:43 AM

Quote:

Originally posted by btedji
here ya go:

NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}



this works, but you'll have to add testing to see if the player name is actually in the string or else if it doesnt it will mess up the string

dude i dont know what you ment by testing it but it works and you are god!!!! ;)))))) :) :) :) :) :D :D

btedji 10-02-2001 03:51 AM

NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;

if(#v(indexof(#t(2),#s(server.jail)))>-1){
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}

}



i added a test that checks to see if players name is in string so the string cant get messed up, see if that works

10-02-2001 03:51 AM

Damn i knew it was to good to be true, it only lets to take off the end accounts...

like if their was server.jail= Joe jack roe
and i said Unjail jack it will set the server.jail= Jo roe
if i put it back to server.jail= Joe jack roe
and if i said Unjail roe it will set it server.jail= Joe jac

so it's a little messed up if you can fix it i will give you like 50 on graal 2001....

10-02-2001 03:54 AM

Quote:

Originally posted by btedji
NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;

if(#v(indexof(#t(2),#s(server.jail)))>-1){
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}

}



i added a test that checks to see if players name is in string so the string cant get messed up, see if that works

umm their says their is a error with #v(indexof(#t(2),#s(server.jail)))

Error: Expected format var, var[i], obj[i].attr, function(a), function(a,b)

btedji 10-02-2001 03:57 AM

try this

NPC Code:

if (playerchats && startswith(Unjail Player,#c))
{ tokenize #c;

if(indexof(#t(2),#s(server.jail))>-1)
{
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail))), #s(server.jail))#e(indexof(#t(2),#s(server.jail))+ strlen(#t(2))+1,-1,#s(server.jail));
}

}


10-02-2001 04:02 AM

DUDE YOU ROCK!!! DO YOU WANT SOME MONEY ON GRAAL 2001??? ALSO I want to do say2 when thay say that so it will say
say2 The player (the person you just unjailed) is now free...

btedji 10-02-2001 04:04 AM

say2 You unjailed #t(2) they are free.

add that into the main equation part

10-02-2001 04:06 AM

ok now, the other part so like if their name is removed from that it will warp them to onlinestartlocal.graal

10-02-2001 04:07 AM

what would it be somehting like
NPC Code:

if (playerenters||timeout){
if (!strcontains(#s(server.jail), #e(12,-1,#c))) {
setlevel2 onlinestartlocal.graal.graal,33,33;
}
}


btedji 10-02-2001 04:07 AM

just use the setlevel2 command in the main equation part, look in the commands.rtf to see how

10-02-2001 04:09 AM

Quote:

Originally posted by Kaimetsu


Only criticism: What if their name is bigger than one word? It can happen.

arg true... I wouldnt know what to do then... :megaeek: :megaeek:

btedji 10-02-2001 04:11 AM

it would be better if you would use the string with account names only

10-02-2001 04:12 AM

Quote:

Originally posted by btedji
it would be better if you would use the string with account names only
huh??

btedji 10-02-2001 04:16 AM

account names dont have spaces so you should only use them in the server.jail string

10-02-2001 04:19 AM

Quote:

Originally posted by btedji
account names dont have spaces so you should only use them in the server.jail string
oh dude one more thing, you know like in the top of unstuck me place their is this thing where if you touch the guy it will show all the people in houses in white writing on the left, well can you do it where it will show all the people in jail?

btedji 10-02-2001 04:20 AM

d00d thats simple

just use the message command to show the server.jail string

10-02-2001 04:26 AM

1 Attachment(s)
Dude you forgot, I dont know how to script stuff that good...
it will show them in a list like
1. account
2. account
3. account
ect....

Aknts 10-02-2001 04:29 AM

He wants like showimg commands like
showimg blah,blah@blah@1. #s(server.jail),x,y;
But the only way I could think if you labeled each person with like server.jail1 and so on unless you can have a npc take everyones account in jail and tokenize them in individuals then tell it to say like showimg blah,blah@blah@1. #t(1)#s(server.jail)),x,y;
#t(1)#s(server.jail)),x,y; that is not going to work im not even looking at my commands so it was just showing you what you would need to do.


All times are GMT +2. The time now is 01:27 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.