Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Showing the PM window from a script (https://forums.graalonline.com/forums/showthread.php?t=73852)

godofwarares 05-06-2007 04:19 PM

Showing the PM window from a script
 
I've been trying to open a PM window from a script (similar to what Zodiac has), but i'm stumped - The only function I can find is showpm(object), but I don't know how to implement this.

Any ideas?

Rapidwolve 05-06-2007 06:51 PM

I think its something like:

PHP Code:

("-Playerlist").openPMWindow(); 

Not sure though

godofwarares 05-09-2007 12:13 AM

I found it.

PHP Code:

isMassMessage false;
pl findPlayer("godofwarares");

(@ 
"-Playerlist").openPmWindow({pl}, isMassMessage); 


Deadly_Killer 05-09-2007 03:16 AM

Unless I am confused.. here are the ways to check information / read pms etc.

PHP Code:

// Read PM
findPlayer("ACCOUNT").openexternalpm(bool);

// false -> open a blank pm window
// true ->  open a pm sent by a player defined by 'account'

// List of pms sent to F2 Window
for (temp.var : allplayers)
{
  if (!
temp.var.pmswaiting()) continue;
  
  echo(
format("%s -> %s"temp.var.account, (temp.var.isadmin "Admin" temp.var.isguildpm() ? "Guild" temp.var.ismasspm() ? "Mass" "Regular")));


Hopefully that could help in some way.

Rapidwolve 05-09-2007 03:25 AM

Never even heard of that function...

Deadly_Killer 05-09-2007 03:29 AM

Then I am glad I somewhat helped you guys =)

contiga 05-09-2007 10:02 AM

(@ "-Playerlist")..... can be changed into just "-Playerlist".function();

Skyld 05-09-2007 02:05 PM

Quote:

Originally Posted by contiga (Post 1306528)
(@ "-Playerlist")..... can be changed into just "-Playerlist".function();

I do not see the benefit.

(@ "-Playerlist").function() makes it entirely clear that you are working with the -Playerlist object.

"-Playerlist".function() makes it look like you are performing a function on the string itself, which could be confusing to some people, especially if they have used other scripting languages where that syntax would mean you are always performing functions on the string.

cbk1994 05-10-2007 12:28 AM

Quote:

Originally Posted by Skyld (Post 1306543)
I do not see the benefit.

(@ "-Playerlist").function() makes it entirely clear that you are working with the -Playerlist object.

"-Playerlist".function() makes it look like you are performing a function on the string itself, which could be confusing to some people, especially if they have used other scripting languages where that syntax would mean you are always performing functions on the string.

I second that.

Also,
temp.i = findWeapon( "-Playerlist" );
temp.i.function();

Twinny 05-10-2007 12:37 AM

findweapon and findnpc are worthless functions in an OO environment =/. I guess they could be used for self-documenting reasons but otherwise unneccessary.


All times are GMT +2. The time now is 06:18 PM.

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