Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Embarassingly easy script I can't figure out (https://forums.graalonline.com/forums/showthread.php?t=12191)

CyanideSR71 09-18-2001 06:05 AM

Embarassingly easy script I can't figure out
 
Why won't this work?

// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (timeout) {
tokenize level.room1names;
message #v(tokenscount);
for (i=0;i<tokenscount;i++) {
if (strequals(#s(#t(i)),#a))hidelocal;
}
if (strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;
}

=/ First time using commands after 1.41....

Cybnext_Design 09-18-2001 06:24 AM

Re: Embarassingly easy script I can't figure out
 
PHP Code:

// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (
timeout) {
tokenize #s(level.room1names);
message #v(tokenscount);
for (i=0;i<tokenscount;i++) {
if (
strequals(#s(#t(i)),#a))hidelocal;
}
if (
strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;


Maybe that should work...

CyanideSR71 09-18-2001 06:38 AM

Nope =/. I know what the problem is... Graal won't tokenize level.room1names for some reason, but I know not how to fix it so it will.

Brady2 09-18-2001 08:14 AM

Re: Re: Embarassingly easy script I can't figure out
 
Quote:

Originally posted by Cybnext_Design
PHP Code:

// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (
timeout) {
tokenize #s(level.room1names);
message #v(tokenscount);
for (i=0;i<tokenscount;i++) {
if (
strequals(#s(#t(i)),#a))hidelocal;
}
if (
strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;


Maybe that should work...

Jadis:

dont use #s(#t(i))
just use #t(i)
it still might not work, but that is how you use tokens

Enigma_GP6 09-18-2001 09:03 AM

-Some Rebel guy Hacking into This Account
PHP Code:

if (playertouchsme){
say2 This NPC is impossibly #b
unneeded;
sleep .5;


-Some Rebel guy Hacking into This Account

CyanideSR71 09-18-2001 09:10 AM

Okay... Is there ANYONE here able to tokenize a defined string?

grim_squeaker_x 09-18-2001 04:02 PM

NPC Code:
if (created) {
setstring test.string,a b c d e f;
tokenize #s(test.string);
message #v(tokenscount);
for (i=tokenscount-1;i>=0;i++) setstring test.string,#s(test.string) #t(i);
}


That should make test.string into "a b c d e f f e d c b a" once it's been run...

toad1413 09-18-2001 04:38 PM

I'm guessing I should learn how to use strings...

CyanideSR71 09-19-2001 02:56 AM

Thanks!!!!
Will that work if the string is set by anohter NPC?

CyanideSR71 09-19-2001 08:28 AM

Quote:

Originally posted by Kaimetsu


Of course. Your problem was that you weren't actually parsing the string - you were parsing the string variable's name because you didn't use #s.

:confused:
Huh? Could you leave an example, Kai... I don't quite get what you say. You use too much jargon that we of lesser vocabulary and knowlegde of wording cannot quite grasp, and without use of simple examples; we are left in the dark...

grim_squeaker_x 09-19-2001 05:40 PM

Quote:

Originally posted by CyanideSR71


:confused:
Huh? Could you leave an example, Kai... I don't quite get what you say. You use too much jargon that we of lesser vocabulary and knowlegde of wording cannot quite grasp, and without use of simple examples; we are left in the dark...

What he's trying to say is that you were tokenizing the word level.room1names instead of the string level.room1names.

grim_squeaker_x 09-19-2001 10:14 PM

Quote:

Originally posted by Kaimetsu


"trying"?

Alright, failing miserably.

grim_squeaker_x 09-19-2001 10:30 PM

Quote:

Originally posted by Kaimetsu


Only to those with low understanding thresholds, Ms Midnight.

Which could be said to mean failing miserably in the case of the average understanding threshold here. :rolleyes:

grim_squeaker_x 09-19-2001 10:40 PM

Quote:

Originally posted by Kaimetsu


I think it would be more accurate to describe those with such thresholds as failing miserably to understand.

Perhaps, yet the explanation is also failing miserably due to the fact that it fails to explain what you were trying to explain to a large number of people.

grim_squeaker_x 09-19-2001 10:53 PM

Quote:

Originally posted by Kaimetsu


You assume that my intention was to help people understand, whereas in reality their confusion is no bad thing to me. If anything, it makes me appear to be more intelligent.

In that case it was the opposite of a miserable failure.

CyanideSR71 09-20-2001 12:11 AM

Ah, but those who are truely intelligent know to be able to speak to the sharper and slower alike. Being obnoxious and attempting to make yourself look better than everyone else in such a way has both been admonished by those who teach English, and makes you look like an ass.
*Waits for you to come back with some witty comeback I won't understand again, so I'll just call you an ass.*

Thanks Lady Midnight! That helps a lot!

CyanideSR71 09-20-2001 12:42 AM

Haha, I just realized I said 'come back with some witty comeback.' Redundency is fun!

CyanideSR71 09-20-2001 01:41 AM

PHP Code:

// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (
timeout) {
setstring level.room1name,#a bob;
tokenize #s(level.room1names);
for (i=0;i<tokenscount;i++) {
if (
strequals(#t(i),#a)) hidelocal;
}
if (
strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;


Why doesn't this work? It still won't tokenize...

Brady2 09-20-2001 09:59 AM

Jadis:

setstring level.room1name,#a bob;
tokenize #s(level.room1names);

look at it and think hard.

CyanideSR71 09-20-2001 10:27 AM

HAHAHAHA!!!! NICE!!!
Okay, it works now, but I want another NPC to set the string, and this NPC to recieve that string and follow through, but it doesn't seem to work. Would this work in online mode? (Please tell me if this is too confusing)

CyanideSR71 09-21-2001 02:56 AM

Quote:

Originally posted by Kaimetsu


Indeed, and I am proud to consider myself able to do this.

No, you babble jibberish to those 99% of the people who wouldn't care to be an wordy as you are, But thanks for the tip on not tokenizing.

CyanideSR71 09-21-2001 03:36 AM

Okay, now you are an ass.

SagaTCN 09-21-2001 04:48 AM

www.dictionary.com is our friend.

CyanideSR71 09-21-2001 07:54 AM

He was talking some coder jargon, Rogue. And nevetheless, if I am forced to use that, what he said was uneffective.

nyghtGT 09-21-2001 08:18 AM

mommy
 
have you seen my mommy ?:spam:

CyanideSR71 09-21-2001 11:20 PM

Your delivery of what you said.

CyanideSR71 09-22-2001 04:24 AM

Odd... I always though you learned from mistakes... And it helps if you know th mistake...


All times are GMT +2. The time now is 10:30 AM.

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