Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-18-2006, 11:43 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Sending PMs by script? Editing player chat bar?

Okay, I have a few ideas to improve how players communicate to each other that I'd like to let the players on Classic have access to.

My questions are:
1. How do you send a pm/guild/mass message by script?
2. Are there any event handlers in the chat bar that would allow direct editing to the chat bar? (if there aren't this is going straight to future improvements)
Reply With Quote
  #2  
Old 02-18-2006, 11:47 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
PM: sendpm("text");


You can edit the GFX of the chatbar.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 02-19-2006, 12:48 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by xXziroXx
PM: sendpm("text");


You can edit the GFX of the chatbar.
1. wouldn't sendpm have a param for something like object, id or account?
2. I mean... editing the chat text as it's being typed... like if the player types << change it to <addhere< as the player types it.
Reply With Quote
  #4  
Old 02-19-2006, 02:43 AM
Chicken_l33t Chicken_l33t is offline
Banned
Join Date: Sep 2002
Location: NewZealand
Posts: 467
Chicken_l33t is on a distinguished road
Quote:
1. wouldn't sendpm have a param for something like object, id or account?
When you use sendpm("message"); it comes from the NPC server to the client that initiated it.

So, just use with (findplayer(params[0])){
sendpm("Hello" SPC params[0] SPC "i love you!");
}
Reply With Quote
  #5  
Old 02-19-2006, 03:26 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Chicken_l33t
When you use sendpm("message"); it comes from the NPC server to the client that initiated it.

So, just use with (findplayer(params[0])){
sendpm("Hello" SPC params[0] SPC "i love you!");
}
zzz
When done from the clientside, it's like you're sending the PM.
I'm going to experiment using this.
__________________
Liek omigosh.

Reply With Quote
  #6  
Old 02-19-2006, 03:31 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
You're not understanding.
One player PMs another player.
The PM comes from the other player
Script function to send PM from one player to the other player is what I'm asking about.
Reply With Quote
  #7  
Old 02-19-2006, 09:18 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by jake13jake
You're not understanding.
One player PMs another player.
The PM comes from the other player
Script function to send PM from one player to the other player is what I'm asking about.
nonexistent.
__________________
Reply With Quote
  #8  
Old 02-19-2006, 03:51 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
When sendpm is used on the clientside, it is sending a pm from the current player.

The Chatbar is a GuiTextEditCtrl. It's name is ChatBar. So for example, you can change its x by doing ChatBar.x = 8675309;
Changing profile:
ChatBar.profile = "GuiBlueTextEditProfile";
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #9  
Old 02-19-2006, 05:52 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
What functions did the V3 PlayerList use for PMs?
__________________
Reply With Quote
  #10  
Old 02-19-2006, 06:42 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Inverness
What functions did the V3 PlayerList use for PMs?
PHP Code:
function onPMSend(obj) {
  
obj.textedit.sendpm(obj.person)

__________________
Liek omigosh.

Reply With Quote
  #11  
Old 02-19-2006, 09:03 PM
hotrian hotrian is offline
Who?
Join Date: May 2003
Location: Eatonville, Washington, 98328
Posts: 56
hotrian is on a distinguished road
Send a message via AIM to hotrian Send a message via MSN to hotrian
http://wiki.graal.us/Script_Functions:_Client
GuiPMEditCtrl (GuiMLTextEditCtrl):
sendmasspm(obj)
sendpm(obj)
GuiPMCtrl (GuiMLTextCtrl):
showpm(obj)
GuiPMHistoryCtrl (GuiMLTextCtrl):
showhistory(obj)

isguildpm() - returns boolean
ismasspm() - returns boolean
pmswaiting() - returns boolean

Hmm?
__________________
Sometimes I wonder if I think too big.
Quote:
Originally Posted by Admins
I've moved the fox map to "levelstoobig/" because a terrain gmap of 1024x1024 levels is clearly too huge (the kingdoms main map is 40x40 and is already quite big). It was taking a lot of memory and was slowing down the computer.
Reply With Quote
  #12  
Old 02-19-2006, 11:34 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by hotrian
http://wiki.graal.us/Script_Functions:_Client
GuiPMEditCtrl (GuiMLTextEditCtrl):
sendmasspm(obj)
sendpm(obj)
GuiPMCtrl (GuiMLTextCtrl):
showpm(obj)
GuiPMHistoryCtrl (GuiMLTextCtrl):
showhistory(obj)

isguildpm() - returns boolean
ismasspm() - returns boolean
pmswaiting() - returns boolean

Hmm?
hmm... so would I have to acquaint myself with the GUI bs to do this?
Reply With Quote
  #13  
Old 02-20-2006, 12:03 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by jake13jake
hmm... so would I have to acquaint myself with the GUI bs to do this?
Basically, a new GuiPMEditCtrl would need to be created. Then you'd do CtrlName.sendpm("account") methinks.

Edit:
Okay so this interested me as well. You must create a new GuiPMEditCtrl() with the profile of GuiMLTextEditProfile or something like that. Then the contents of the Ctrl will be sent by using the CtrlName.sendpm(findplayer("account")) function. The F2 window will then show the "PM Sent" text.
__________________
Liek omigosh.


Last edited by Ajira; 02-20-2006 at 12:31 AM..
Reply With Quote
  #14  
Old 03-06-2006, 01:44 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally Posted by Ajira
zzz
When done from the clientside, it's like you're sending the PM.
I'm going to experiment using this.

this is a false statement :-x
Reply With Quote
  #15  
Old 03-06-2006, 01:51 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
If you want to send a pm directly to another client then you will need to use a GuiPMEditCtrl. This is to make sure the player is editing the text, scripts don't have access to the text of that Gui control.
If it's possible to manipulate the default chatbar then we will need to add a protection against that.
It wouldn't be good if scripts could send PMs in the name of the player, or send chat messages in the name of the player. Sometimes security is better than functionality. There are also reasons why the scripted RC doesn't have the same functionality like external RC yet.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:45 AM.


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