Page 1 of 1

Inviting Party Members

Posted: Fri Apr 20, 2012 2:56 pm
by whyme
I am trying to run several alt characters in an instance. I am having an issue with inviting party members. First, the InviteByName function gives me an error of

[string "..."]:27 attempt to call global 'InviteByName' (a nil value)

I have tried putting the argument of InviteByName into another variable and even directly putting the characters name in quotes, and I cannot get it to work anymore. I say anymore, since I thought there was a time I could directly use InviteByName("toon1") and it would work.

Also, I actually want the invite to be an honor party invite. How do I do an honor party invite?

******************************************
valid_characters = {
'toon1', 'toon2', 'toon3', 'toon4',
};

repeat

local obj = nil;
local objectList = CObjectList();
objectList:update();

character_detected = false;
for i = 0,objectList:size() do
obj = objectList:getObject(i);
if( obj.Type == PT_PLAYER ) then
local pawn = CPawn(obj.Address);
if( table.contains(valid_characters, pawn.Name) ) then
character_detected = true;
printf("character detected! Name: %s\n", tostring(pawn.Name));
InviteByName(pawn.Name);
end
end
end

yrest(1000)

until character_detected == true;

yrest(1000)

keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
yrest(1000)
keyboardRelease( settings.hotkeys.MOVE_FORWARD.key )
waitForLoadingScreen()

Re: Inviting Party Members

Posted: Fri Apr 20, 2012 10:36 pm
by lisa
--=== Moved ===--
This sub forum is not for;

1. Making suggestions for userfunctions, waypoint files, scripts etc.
2. Talking about files that have there own threads elsewhere.
3. Starting a project that never gets finished.

This thread is for;

1. Sharing a userfunction, waypoint file, script etc. for others to share. Basically, if you don't have a file to attach then don't start a thread here.

If you are just starting a project and are still in the discussion phase but have nothing to post yet then you should start in the main "Runes of Magic" forum.

Re: Inviting Party Members

Posted: Fri Apr 20, 2012 10:39 pm
by lisa
If you are trying to use the in game function then you need to use RoMScript

Code: Select all

RoMScript("InviteByName("..pawn.Name..");")

Re: Inviting Party Members

Posted: Sat Apr 21, 2012 12:45 am
by rock5
Except you forget the quotes around the string.

Code: Select all

RoMScript("InviteByName(\""..pawn.Name.."\");")