Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I noticed that.. (https://forums.graalonline.com/forums/showthread.php?t=9744)

Knightoffrost 08-16-2001 11:36 PM

I noticed that..
 
A lot of people use "(playerchats&&strequals(#c,blah)" instead of "(playersays(blah))" ...

Why is that? playersays is much more easy and smaller which means less characters which means less time the computer takes reading the info (even if its a fast simple action anyway) which just means slightly more speed in it all I guess. But why do people use playerchats and strequals instead of playersays?

ownerofbabylon 08-16-2001 11:40 PM

I used to use playersays but I was told by many that its widely discouraged. I guess its not as fast or efficient or somthing.

Knightoffrost 08-16-2001 11:50 PM

Quote:

Originally posted by ownerofbabylon
I used to use playersays but I was told by many that its widely discouraged. I guess its not as fast or efficient or somthing.
Stupid (not you)
I cant see why its not efficient. I use it all the time "Online" and it works fine. And its smaller in characters so it would be the more efficient one.

Xaviar 08-17-2001 12:39 AM

By using playerchats though...You get a whole slew of stuff like startswith(), tokenize, and all that fun stuff....people just get used to using playerchats outa habit because they use it for stuff like I just said...Anyways..thats why I think they do it...

ownerofbabylon 08-17-2001 12:41 AM

yea i just got used to it so i use that now =\

LiquidIce00 08-17-2001 02:36 AM

actually its because Stefan never put playersays in the npc server. so if you do playersays in a p2p script it wont work .you need playerchats&&strequals(#c,whatever)

Brady2 08-17-2001 03:00 AM

Jadis:

BECAUSE PLAYERSAYS GETS BUGGED EVERY OTHER VERSION SO IF YOU DO LIKE
IF (PLAYERSAYS(NO)) SAY2 NO!;

THE SIGN WILL KEEP APPEARING IF THE #C IS EQUAL TO NO

Also because you're anus is sore.

LiquidIce00 08-17-2001 03:15 AM

Quote:

Originally posted by Brady2
Jadis:

BECAUSE PLAYERSAYS GETS BUGGED EVERY OTHER VERSION SO IF YOU DO LIKE
IF (PLAYERSAYS(NO)) SAY2 NO!;

THE SIGN WILL KEEP APPEARING IF THE #C IS EQUAL TO NO

Also because you're anus is sore.

no=\

BocoC 08-17-2001 03:30 AM

Re: I noticed that..
 
Quote:

Originally posted by Knightoffrost
A lot of people use "(playerchats&&strequals(#c,blah)" instead of "(playersays(blah))" ...

Why is that? playersays is much more easy and smaller which means less characters which means less time the computer takes reading the info (even if its a fast simple action anyway) which just means slightly more speed in it all I guess. But why do people use playerchats and strequals instead of playersays?

Ok. Playersays(text) is the same as strequals(#c,text). People use
NPC Code:

if (playerchats && strequals(#c,text)) { }


because the code will only run WHEN the player changes his chat field.
Try these codes out:
NPC Code:

if (playersays(buy me)) {
playerrupess-=10;
}


NPC Code:

if (playerchats && strequals(#c,buy me)) {
playerrupees-=10;
}


See the difference?

LiquidIce00 08-17-2001 03:36 AM

playersays was removed from npc server wasnt it?

Knightoffrost 08-17-2001 03:55 AM

Quote:

Originally posted by LiquidIce00
playersays was removed from npc server wasnt it?
Errm I wouldnt know actually.Why would it be?


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

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