Page 1 of 1

KeyPressed issue - key.VK_SHIFT

Posted: Mon Feb 01, 2010 6:48 pm
by Romulan
Ok im setting up a waypoint file to get mail from the mailbox.
When pressing the shift key and then clicking on anything you can interact with in game makes other characters not possible to click on at that time.
So here is my waypoint file

Code: Select all

<waypoints>
	<!-- #  1 --><waypoint x="-443" z="-6114">	</waypoint>
	<!-- #  2 --><waypoint x="-416" z="-5996">		
		player:keyPressed(key.VK_SHIFT);
		player:mouseclickL(950, 515, 1920, 1148);
		player:keyboardRelease( key.VK_SHIFT );
		sendMacro("ChoiceOption(1);");
		player:rest(1);
		RoMScript( "RoMail_GetAllAttachments();" );
		player:rest(10);
		inventory:update();
		loadPaths("mail2spawn");
	</waypoint>
</waypoints>
Now i get an error in relation to the first keypressed command:

[string " ..."]:2: attempt to call method 'keyPressed' (a nil value)

Any ideas?

Re: KeyPressed issue - key.VK_SHIFT

Posted: Mon Feb 01, 2010 10:11 pm
by j_schlott
try

Code: Select all

keyboardHold(key.VK_SHIFT);
and

Code: Select all

keyboardRelease(key.VK_SHIFT);
and you dont need the "player:" part

Re: KeyPressed issue - key.VK_SHIFT

Posted: Mon Feb 01, 2010 11:42 pm
by Administrator
keyPressed() is not a member of player, hence, it is nil.

Re: KeyPressed issue - key.VK_SHIFT

Posted: Tue Feb 02, 2010 3:56 am
by Romulan
Ok cool ill give it a shot :)

I thought i needed player cos i saw it infront of the mouse movement part.
Good to know for future