get the guild of player
get the guild of player
for access to name player, the variable is player.Name. For access the level of player, the variable is player.Level. What variable is used for access to guild of player? I try player.Guild, but don't work for me. Thank you in advace.
Re: get the guild of player
There is none, you would need to use an ingame function of some kind to get the guild info.
Only one I can think of at the moment is AskPlayerInfo("charname")
Needless to say guild of a player is more complicated than just doing player.Name, do you really need it?
Only one I can think of at the moment is AskPlayerInfo("charname")
Needless to say guild of a player is more complicated than just doing player.Name, do you really need it?
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: get the guild of player
If I remember correctly AskPlayerInfo("charname") only prints to the screen which is pretty useless. I know you needed to use it for gmmonitor but if all the user wants is the players guild name they can use GetGuildInfo(). That's what I used in the AT script. So
If you need more information about your guild, that function does return more values.
I'll leave you to figure out what they all mean if you need them.
Code: Select all
GuildName = RoMScript("GetGuildInfo()")Code: Select all
local guildName, leaderName, bRecruit, alreadyCreate,
MaxMemberCount, Score, GuildNote, Introduce,
isLeader, isBBSEnable, isOpenGuild, Level, IsOwnHouse, IsOpenVisit = GetGuildInfo();- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: get the guild of player
Ahh yes I was assuming they wanted guild of a different character, not the character they were logged on to.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: get the guild of player
Thank your very much for your fast answer. I´ll try apply your solutions.
Re: get the guild of player
Hi again. I found what i was looking. The function what i want is: "UnitIsInMyGuild= Returns whether a unit is in the player's guild". Try the code:
But give me an error. I think return a nill value, but i´m not sure (IGF: [STRING "LOCAL A={UnitIsInMyGuild (object)} return a"]:1: attempt to call global 'UnitIsInMyGuild' (a nil value). May be that this function isn´t implemented in rombot, or some thing similar.
I want add this code an a function similar of the created by lisa GM:detection, and give an alarm to me if someone of my guild its near. Could you help me, please? thank you in advance
Code: Select all
help="object"; --object was the name of the object.
if (RoMScript ("UnitIsInMyGuild ("..help..")")) then
print("GREAT!");
end
I want add this code an a function similar of the created by lisa GM:detection, and give an alarm to me if someone of my guild its near. Could you help me, please? thank you in advance
Re: get the guild of player
lol I was right, you do want the guild of another character.
Well you will need to add in the code yourself as I don't want the GM monitor to detect other guild members.
So basically you want to add in another check in the userfunction for if your guild name is posted with the AskPlayerInfo that it does. Gm monitor only does this when whispered, so basically you will need to add in your own funtion or just make a new userfunction for yourself.
This is very basic, you should really add the obj.Name to a table so it only calls it once and not repeatedly, plus some tweaking here and there.
Have fun
Well you will need to add in the code yourself as I don't want the GM monitor to detect other guild members.
So basically you want to add in another check in the userfunction for if your guild name is posted with the AskPlayerInfo that it does. Gm monitor only does this when whispered, so basically you will need to add in your own funtion or just make a new userfunction for yourself.
Code: Select all
local obj = nil;
local objectList = CObjectList();
objectList:update();
for i = 0,objectList:size() do
obj = objectList:getObject(i);
if( obj.Type == PT_PLAYER ) then
EventMonitorStart("GuildDetect", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'"..obj.Name.."\');")
yrest(1000)
local time, moreToCome, msg = EventMonitorCheck("GuildDetect", "1")
if msg ~= nil then
if string.find(msg,"Addyourguildnamehere") then
if playalarm then playalarm() playalarm() end
-add what ever else you want to do, like logout
end
end
end
end
Have fun
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: get the guild of player
you are really fast!!.
I add your code, and work prefectly. if I had thought a little more, i would have found the solution too, because I had already used the "askplayerinfo" and the "EventMonitorCheck" in other times. Thank you very much for your help.
I still have a little doubt. Is it better to add the "EventMonitorStop" at the end, or really does not affect performance?
I add your code, and work prefectly. if I had thought a little more, i would have found the solution too, because I had already used the "askplayerinfo" and the "EventMonitorCheck" in other times. Thank you very much for your help.
I still have a little doubt. Is it better to add the "EventMonitorStop" at the end, or really does not affect performance?
Re: get the guild of player
probably best to add it at end,Ajoir wrote:I still have a little doubt. Is it better to add the "EventMonitorStop" at the end, or really does not affect performance?
you see the addon itself will continue monitoring the guild messages long after you stop botting, basically until the game is fully exited it will continue to monitor guild chat.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Who is online
Users browsing this forum: No registered users and 16 guests