Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2005, 03:00 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
Npc Message

how can i make the npc server send out another message when the player pms it saying a word like "Nat Applacation"
__________________
account was being used by jigga.... sorry for what he has said in the past
Reply With Quote
  #2  
Old 09-22-2005, 03:23 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by alissalee
how can i make the npc server send out another message when the player pms it saying a word like "Nat Applacation"
(These go into the Control-NPC)

There's a function, onPM(), that is called when the player PMs the NPCServer. Fiddle around with the params, I think the first one is the account and the second one is the text. Using some crazy if-statements, you can find a way to check if the text is equal to something. Then, you can use the sendpm(text) function to send the reply. Note, this is serverside, yanno.
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #3  
Old 09-22-2005, 07:13 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
If you are using GS1, instead of onPM(), use:
PHP Code:
if (pm) {
  
//stuff

__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #4  
Old 09-22-2005, 07:31 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
In GS2, you'd have something pretty close to this:
PHP Code:
function onPM(something,text){
  if (
text == "Nat Application")
   
sendPM("Sorry; We aren't seeking assistance in NPCs currently! Thanks anyways.");

__________________
In a world of change... Who'll you believe?
Reply With Quote
  #5  
Old 09-22-2005, 07:37 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Just curious, is it possible to leave the account part blank?
__________________
torankusu's
Reply With Quote
  #6  
Old 09-22-2005, 07:59 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Torankusu_2002
Just curious, is it possible to leave the account part blank?
You mean in the onPM() parameters?

If so, I think you can probably do:
PHP Code:
function onPM(" "message) {


I don't know why you would though.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #7  
Old 09-22-2005, 10:28 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Quote:
Originally Posted by Torankusu_2002
Just curious, is it possible to leave the account part blank?
PHP Code:
function onPM()
{
  echo(
"Someone said :" params[1]);

Works just as well.. It's just hard clearing the first param and identifying the second.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #8  
Old 09-22-2005, 01:45 PM
Silent Silent is offline
<3
Silent's Avatar
Join Date: Mar 2005
Location: England
Posts: 132
Silent is on a distinguished road
Send a message via AIM to Silent Send a message via MSN to Silent
Quote:
Originally Posted by napo_p2p
Quote:
Originally Posted by Torankusu_2002
Just curious, is it possible to leave the account part blank?
I think you can probably do:
PHP Code:
function onPM(" "message) {


A space isn't a nothing o.O

("",message)
__________________
Quote:
Originally Posted by MilkyWay0016
The Bible also says things like...

"Stone disobedient children" (Deuteronomy 21:18-21)
Quote:
Originally Posted by Loriel
Disobedient children are likely enough to get stoned already, I think.
Reply With Quote
  #9  
Old 09-22-2005, 06:24 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Silent
A space isn't a nothing o.O

("",message)
Heh, just noticied that I put a space.

But then again, does it have to be nothing?
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #10  
Old 09-22-2005, 07:16 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
  • The first parameter is not the account name.
  • Why are you putting "" in place of a variable?
  • Velox Cruentus is right. If you're only going to use one parameter, then why are you wasting your time with a new variable when params[1] works just as well?
__________________
Skyld
Reply With Quote
  #11  
Old 09-23-2005, 01:32 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Quote:
Originally Posted by napo_p2p
PHP Code:
function onPM(" "message) { 


hahaha bad idea


and as for the params, use all or none.
also, adding variables there doesn't tell the function what to put where, it just gives names for things. the first variable will always be the first paramater, and the second variable will always be the second.

Quote:
function onKeypressed(key,code)
function onKeypressed(code,key)
function onKeypressed(code)
function onKeypressed(key)
if you do things like this, you're bound to get yourself confused.
__________________
Reply With Quote
  #12  
Old 09-23-2005, 02:23 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by calani
if you do things like this, you're bound to get yourself confused.
PHP Code:
onKeyPressed(code,key) {

'code' is the asciival of the key
'key' is the key

Memorize that Ashy. :P
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #13  
Old 09-23-2005, 02:32 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
lol, I didn't know how to bypass a param. I guess the " " isn't a good idea then .
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #14  
Old 09-23-2005, 06:55 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
what's the syntax for omPM() then?
__________________
torankusu's
Reply With Quote
  #15  
Old 09-23-2005, 07:54 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
try this (GS2):

PHP Code:
function onPM() {


params[1] is the message that the NPC server recieved in the PM.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:57 PM.


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