Page 1 of 1

Invite guild member to party

Posted: Mon Oct 29, 2012 5:58 am
by botje
seeying all my alts are in my guild, a botguild xd, would i be able to see which one is online and invite it to party automaticly?

that way i dont have to have a whole list of invite to party lines with all my alt names, but just invite the one online in my guild.

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 6:08 am
by lisa
http://www.theromwiki.com/API:GetGuildRosterInfo

This bit is what you want to know
IsOnLine

Code: Select all

local name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine, LogOutTime, Zone, Note = GetGuildRosterInfo(i);
I am sure you can work out how to use it ;)

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 9:47 am
by botje
what about this?

Code: Select all

function JoinParty(YourName)
	local name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine, LogOutTime, Zone, Note = RoMScript("GetGuildRosterInfo(1)");
	local count = 1
	 
	while IsOnLine == false and rank == 10 do
		IsOnLine = RoMScript("GetGuildRosterInfo(count)");
		
		count = count + 1
	end
	
	printf("Debug:  "..name.." \n");
	printf("Debug:  "..IsOnLine.." \n");
	printf("Debug:  "..rank.." \n");
	
	sendMacro('InviteByName('..name..')');
end
this is as far as i get, but now it tries to invite myself xd

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 10:25 am
by rock5

Code: Select all

IsOnLine = RoMScript("GetGuildRosterInfo(count)");
What this does is only take the first returned value, which happens to be 'name', and put it into the variable 'IsOnLine'. If you want IsOnLine you are going to have to take at least the first 11 returned values.

Code: Select all

name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine= RoMScript("GetGuildRosterInfo(1)");
It also lets you get the rank which you want to use.

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 10:26 am
by botje
oh, so the 1 in that example stands for first value? i thought it was the index from the list.

or i need to make that whole line with it?

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 10:31 am
by rock5
Sorry, should be

Code: Select all

name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine= RoMScript("GetGuildRosterInfo("..count..")");
And yes, 'count' is the index in the list of guildies.

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 10:34 am
by botje
k cool, ill try again then ^^

Re: Invite guild member to party

Posted: Mon Oct 29, 2012 4:51 pm
by botje
got it ^^

Code: Select all

function JoinParty()
	local name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine, LogOutTime, Zone, Note = RoMScript("GetGuildRosterInfo(1)");
	local count = 1
	 
	while IsOnLine == false or rank == 10 do
		name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine= RoMScript("GetGuildRosterInfo("..count..")");
		count = count + 1
	end
	
	--printf("Debug:  "..count.." \n");
	--printf("Debug:  "..name.." \n");
	--printf("Debug:  "..rank.." \n");
	
	sendMacro('InviteByName("'..name..'")');
end

Re: Invite guild member to party

Posted: Tue Oct 30, 2012 1:12 am
by rock5
It will work but the 'count' will be off by one for all except the first member. Instead of getting the info first then doing a 'while' loop you could have just used a 'repeat' loop.

Code: Select all

count = 0
repeat
    count = count + 1
    name, rank, class, level, subClass, subLevel, isHeader, isCollapsed, dbid, guildTitle, IsOnLine= RoMScript("GetGuildRosterInfo("..count..")");
until IsOnLine == true and rank ~= 10