Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Python Set list

 
Post new topic   Reply to topic Printable version
 View previous topic  Errors from non-existing file Post :: Post Two questions  View next topic  
Author Message
Bassnectar
Newbie


Joined: May 08 2011
Posts: 5
Offline

PostPosted: Sun May 08, 2011 11:05 pm    Post subject: Python Set list Reply to topic Reply with quote

I was wonder what was holding back sending to a set or list of players using python. I notice in chat.h its noted that there isn't support for it yet, what would it take to get this feature working?
Back to top
View users profile Send private message Add User to Ignore List
JoWie
Server Help Squatter


Gender:Gender:Male
Joined: Feb 25 2004
Posts: 215
Offline

PostPosted: Mon May 09, 2011 6:38 am    Post subject: Reply to topic Reply with quote

This was added 2 years ago. The comment in chat.h is old and should probably be removed.

In python you need to use a asss.PlayerListType object.
It goes like this:
Code: Show/Hide

import asss
chat = asss.get_interface(I_CHAT)

list = asss.PlayerListType()
list.append(p)
list.append(another_p)
chat.SendSetMessage(list, "bla")


This object can be used anywhere where you would normally pass a LinkedList containing Player's (look for pyint: playerlist)
Back to top
View users profile Send private message Add User to Ignore List
Bassnectar
Newbie


Joined: May 08 2011
Posts: 5
Offline

PostPosted: Tue May 10, 2011 3:39 pm    Post subject: Reply to topic Reply with quote

Oh interesting!

Is there a way to not have to append each player, say I wanted to send to the entire arena? Or would I have to do list.append(p) for each player that enters. and list.remove(p) for when they leave?
Back to top
View users profile Send private message Add User to Ignore List
JoWie
Server Help Squatter


Gender:Gender:Male
Joined: Feb 25 2004
Posts: 215
Offline

PostPosted: Tue May 10, 2011 4:57 pm    Post subject: Reply to topic Reply with quote

There is SendArenaMessage and SendArenaSoundMessage:

Code: Show/Hide

chat.SendArenaMessage (arena, "bla bla")
chat.SendArenaSoundMessage(arena, asss.SOUND_GIRL, "bla bla")


If you want to send a custom message you will have to loop over every player
Code: Show/Hide

list = asss.PlayerListType()
def getMyPlayers(p):
   if (p.arena == arena):
      list.append(p)
asss.for_each_player(getMyPlayers)
chat.SendAnyMessage(list, asss.MSG_SYSOPWARNING, 0, None, "bla bla")
Back to top
View users profile Send private message Add User to Ignore List
rose61
Newbie


Age:33
Gender:Gender:Female
Joined: Mar 14 2015
Posts: 1
Offline

PostPosted: Sat Mar 14, 2015 11:36 am    Post subject: Reply to topic Reply with quote

I wanted to send to the entire arena? Or would I have to do list.append(p) for each player that enters.
__________________
You can easily check out our high quality Testking pmp certificate which prepares you well Testking compass test questions for the You can also get success in real fmuniv.edu with the quality
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 476 page(s) served in previous 5 minutes.

phpBB Created this page in 0.543233 seconds : 31 queries executed (75.6%): GZIP compression disabled