Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   -Playerlist functions & loading buddies from Server (https://forums.graalonline.com/forums/showthread.php?t=134265552)

callimuc 01-09-2012 11:35 PM

-Playerlist functions & loading buddies from Server
 
Well I got 2 questions in this thread (didn´t want to post 2 threads).

First question:
I wanted to mess around with the Playerlists functions. I have been testing around getting the default Playerlists functions (default weapon name: -Playerlist). I wanted to ask if someone knows the parameters for the functions or how I could get them (via Script?), just like I can call the functions using (@"-Playerlist").getfunctions().
And which functions can actually get really used for other purposes (like onPMsend() could be usefull for other scripts)?

Here is also a list of them:
PHP Code:

getAccountGroup
onPlayerChanges
addGroupsToMenu
getOrderGroup
performSearch
addPlayerToList
dblClickOnPlayer
onSearchTyped
onServerListerConnect
onReceiveText
addGroupHeader
onPMSend
getGuildListEntry
drawPlayerHeadOnPanel2
initPlayerList
drawOptionsPanel
anyPmsWaiting
getGroupFile
forcePlayerListShow
displayPlayerOnSpecifiedList
onPlayerLogout
updateTabIcons
onOpenPlayerlist
getRealLevelName
onPMHistory
sortPlayerlist
getServerListEntry
drawPlayerMessageIcon
onToggleScriptedPlayerList
getPlayerHint
onDefaultStyleChanges
drawPlayerHead
onSortPlayerList
onPMClose
onDestroySearchWindow
onControlKeyDown
onMapClick
loadOptionsConfig
onPM
loadGroupLists
getTranslatedNick
onSaveConfig
onURLClick
onPMWindowKey
updatePlayerCount
onPlayerLogin
onOpenSelectedPlayerPM
updateButtonPositions
displayPlayerOnList
onServerLogin
drawPlayerHeadOnPanelNoDefault
setGUIStyle
lastRow
addPlayerList
onPlayerListEnter
onReOrderList
openHistoryWindow
openPMWindow
drawPlayerHeadOnPanel
onPlayerListSelectAll
onFirstResponderChanges
onSelectOptionsCheckBox
showSearch
setAccountGroup
getOptionsNick
saveOptionsConfig
onPMKey
drawPListIcons
getGUIStyle 


Second question: (solved until further suggestions)
How could I load the buddies of a player from the server? Since I saw that option on the F3 settings, I thought they wouldn´t be saved on the clients buddyaccounts.txt. Or am I wrong?

cbk1994 01-10-2012 12:05 AM

You can get the online buddies of a player by checking otherPlayer.isBuddy (clientside). I don't think you can get a full list without some hackish stuff.

callimuc 01-10-2012 01:23 AM

Quote:

Originally Posted by cbk1994 (Post 1681413)
You can get the online buddies of a player by checking otherPlayer.isBuddy (clientside). I don't think you can get a full list without some hackish stuff.

Hmm ok thanks about that.

Skyld 01-10-2012 01:45 PM

Quote:

Originally Posted by callimuc
I wanted to mess around with the Playerlists functions. I have been testing around getting the default Playerlists functions (default weapon name: -Playerlist). I wanted to ask if someone knows the parameters for the functions or how I could get them (via Script?), just like I can call the functions using (@"-Playerlist").getfunctions().

Most of the functions in the playerlist script are not public anyway; the only interesting functions are:
  • anyPmsWaiting()
  • addCustomMenuEntry(int entry id, string entry text)
  • openPMWindow({TServerPlayer player object, TServerPlayer player object, ...}, boolean is mass PM)
  • openHistoryWindow(TServerPlayer player object)
Functions that aren't listed here are either inaccessible or of no use to you, for a variety of reasons.
Quote:

Originally Posted by callimuc
How could I load the buddies of a player from the server? Since I saw that option on the F3 settings, I thought they wouldn´t be saved on the clients buddyaccounts.txt. Or am I wrong?

The playerlist handles most of this already, and the list of players synced with the server should be written out to scriptfiles/groupBuddies.txt. I would suggest editing this file is not a great idea; I think changes will be overwritten on next connect.

callimuc 01-10-2012 03:10 PM

1 Attachment(s)
Quote:

Originally Posted by Skyld (Post 1681444)
Most of the functions in the playerlist script are not public anyway; the only interesting functions are:

Thanks. Maybe I can get some use of them. Will mess around with them when I'm on the computer.

Quote:

Originally Posted by Skyld (Post 1681444)
I would suggest editing this file is not a great idea; I think changes will be overwritten on next connect.

No I didn't want to overwrite them, just wanted to test something where I need to load the buddies (stored on client and on the server)


EDIT:

anyPmsWaiting() is there any way to check whos PM´s are still waiting to get checked?
---Nevermind figured out that I can use player.pmswaiting()---


Another Edit:
Have been using something like this (just a part of the script):
code
My problem: The PM window won´t open, instead of that I get like 15 windows opened with a PM window from that player but no text. Already tried looking at other scripts where it has been working but don´t seem to get it working.

Tigairius 02-11-2012 10:33 PM

Quote:

Originally Posted by callimuc (Post 1681446)
Have been using something like this (just a part of the script):
code
My problem: The PM window won´t open, instead of that I get like 15 windows opened with a PM window from that player but no text. Already tried looking at other scripts where it has been working but don´t seem to get it working.

Just wanted to follow up this post. I read the code in the playerlist and I think the reason you're having this issue is because you can't PM yourself. Try opening the PM object of another player and it should work fine. I'll see about either fixing it or returning nothing when you try to open your own PM window.

callimuc 02-12-2012 03:00 PM

Quote:

Originally Posted by Tigairius (Post 1684292)
Just wanted to follow up this post. I read the code in the playerlist and I think the reason you're having this issue is because you can't PM yourself. Try opening the PM object of another player and it should work fine. I'll see about either fixing it or returning nothing when you try to open your own PM window.

It happened with every player. Also I think that one was my RC which you can actually PM.


All times are GMT +2. The time now is 12:02 AM.

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