Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Old Scripting Engine (GS1) (https://forums.graalonline.com/forums/forumdisplay.php?f=154)
-   -   Help (https://forums.graalonline.com/forums/showthread.php?t=65536)

Omini 04-21-2006 03:17 AM

Help
 
How would I go about it so that if the player said something (eg. /help), the NPC Server sends a pre-set PM?

Yen 04-21-2006 03:19 AM

Check if the player says /help in a system weapon.
When it checks that they said /help, make it send a trigger to the serverside telling the NPC Server (or the system) to send the PM.

Omini 04-21-2006 03:21 AM

So in the system NPC -

NPC Code:
if (playerchats) {
if (strequals(#c,/help)) {
triggeraction 0,0,serverside,"NPC-Control",help;
}
}



And System NPC -

NPC Code:
if (actionserverside) {
if (strequals(#p(0),help)) {
sendpm Pre-defined PM;
}
}



EDIT: Replacing "NPC-Control" with the correct NPC name

xXziroXx 04-21-2006 02:07 PM

Or,

NPC Code:

function onPlayerChats()
{
if (player.chat == "/help") sendpm("All text here, HTML works!");
}



This is a serversided script.

Omini 04-21-2006 02:41 PM

The more I see GS2 scripting, the more I hate it.

Heh. Thanks for your help :)

Skyld 04-21-2006 02:42 PM

Quote:

Originally Posted by Omini
The more I see GS2 scripting, the more I hate it.

Heh. Thanks for your help :)

I am not sure why - the new engine makes much more sense than the old one.

xXziroXx 04-21-2006 03:00 PM

Same thing but in GS1 then:

NPC Code:

if (playerchats && strequals(#c,/help)) sendpm All text here, HTML works!;




GS1 sucks.

Raeiphon 04-21-2006 03:46 PM

Why post for help in the gs2 forums then? =/

Skyld 04-21-2006 04:31 PM

Moved thread to the correct forum.

Omini 04-21-2006 04:41 PM

Quote:

Originally Posted by xXziroXx
Same thing but in GS1 then:

NPC Code:

if (playerchats && strequals(#c,/help)) sendpm All text here, HTML works!;




GS1 sucks.

I tried that first and it didn't work, so I asked for help.

Quote:

Originally Posted by Skyld
I am not sure why - the new engine makes much more sense than the old one.

True, but I just get confused with all that stuff. Heh. Wait till Stefan makes a new scripting language in the future and call it GS3 - then I'll get the hang of GS2 (because I seem to be getting the hang of GS1... heh... perhaps a little GS2, but I don't really know).

Quote:

Originally Posted by Raeiphon
Why post for help in the gs2 forums then? =/

I posted it in the GS2 forum because my server is enabled for GS2, and I find that GS2 screws around with GS1 scripts sometimes.

Raeiphon 04-21-2006 06:38 PM

Alot of Developers still code in GS1, but I find GS2 to be far more efficent, and definately more fun to work with. It's also easier to read GS2 long, single lined statements, than GS2:

GS1 - if (playerchats && strequals(#c,/help)) sendpm All text here, HTML works!;
GS2 - if(player.chat=="/help") { sendpm("Blahstringblah"); }


All times are GMT +2. The time now is 05:18 AM.

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