Inviting Party Members
Posted: Fri Apr 20, 2012 2:56 pm
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()
[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()