Page 1 of 1

How to open Itemshop...

Posted: Fri Nov 26, 2010 11:08 am
by Personalausweis
...with script command?

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 5:54 pm
by rock5
I managed to open it with

Code: Select all

/script ItemMallFrame:Show()
So from rombot it would be,

Code: Select all

RoMScript("ItemMallFrame:Show()")
but I don't see many commands to use it.

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 6:17 pm
by Personalausweis
nice thanks

i also have a problem with my functiion which should enter my sec PW

Code: Select all

function sec_pw()
acconame = RoMScript("GetAccountName();");
if accname == "Testingacc"
	then
	keyboardType("SecPW");
	else
	if accname == ("Acc1") or ("Acc2") or ("Acc3") or ("Acc4") or ("Acc5")
	then
	keyboardType("SecPW");
	else
	if accname == ("Acc6") or ("Acc7")
		then
		keyboardType("SecPW");
		else
		keyboardType("SecPW");
	end;
end;
end;
end
it enters the PW but always puts a 0 (zero) in front of the PW in the field.

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 6:31 pm
by rock5
First let me rewrite that code for you.

Code: Select all

function sec_pw()
acconame = RoMScript("GetAccountName();");
if accname == "Testingacc" then
   keyboardType("SecPW");
elseif accname == ("Acc1") or accname == ("Acc2") or accname == ("Acc3") or accname == ("Acc4") or accname == ("Acc5") then
   keyboardType("SecPW");
elseif accname == ("Acc6") or accname == ("Acc7") then
   keyboardType("SecPW");
else
   keyboardType("SecPW");
end;
end
As to the zero, that is usually caused by the bot trying to use the macro ie RoMScript. What you need to do it make sure you stop using RoMScript commands before the password box appears and don't start using it again until it is gone.

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 6:38 pm
by Personalausweis
and how shall i do that????

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 6:44 pm
by rock5
Personalausweis wrote:and how shall i do that????
I'd need to look at your code to help you further.

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 6:54 pm
by Personalausweis
-.- of course sry am a bit drunk^^

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
    include( "/userfunctions/addon_sec_pw.lua");
</onLoad>
	<!-- #  1 --><waypoint x="14" z="40">
		RoMScript("ItemMallFrame:Show()");
		yrest(100)
		player:mouseclickL(429, 146, 1024, 768); clicks token shop
		yrest(500);
		player:mouseclickL(58, 298, 1024, 768); double clicks category with puris
		player:mouseclickL(58, 298, 1024, 768); 
		yrest(100);
		player:mouseclickL(343, 200, 1024, 768); clicks buy button
		yrest(500);
		player:mouseclickL(245, 394, 1024, 768); clicks confirm to buy 1 pury
		sec_pw(); shall enter sec pw
--		player:mouseclickL(448, 205, 1024, 768); clicks confirm sec pw
	</waypoint>
</waypoints>

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 9:36 pm
by rock5
Hm... if the password box is coming up when you 'confirm to buy 1 pury' then, when you run sec_pw(), the RoMscript command in sec_pw() will send 0s to the password edit box.

Try getting the account name first beforehand and send it as an argument to sec_pw().

Code: Select all

      acconame = RoMScript("GetAccountName();");
      player:mouseclickL(245, 394, 1024, 768); clicks confirm to buy 1 pury
      sec_pw(acconame ); shall enter sec pw
Then change sec_pw like this

Code: Select all

function sec_pw(accname)
if accname == "Testingacc" then
   keyboardType("SecPW");
elseif accname == ("Acc1") or accname == ("Acc2") or accname == ("Acc3") or accname == ("Acc4") or accname == ("Acc5") then
   keyboardType("SecPW");
elseif accname == ("Acc6") or accname == ("Acc7") then
   keyboardType("SecPW");
else
   keyboardType("SecPW");
end;
end

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 10:43 pm
by Personalausweis
ok i made the changes you suggested.

one problem solved, 2 new appeared ^^

solved:
no 0 in fron of PW

new1:
a 0 behind th PW

new2:
wrong PW in box O.o
tested it with "testingacc" and he typed secPW from the very last else part -.-

Re: How to open Itemshop...

Posted: Fri Nov 26, 2010 11:38 pm
by rock5
Personalausweis wrote:new1:
a 0 behind th PW
Maybe the mouse click to close the password box missed? Wait, is it still commented out? If it clicks and closes the password box then the 0 wont appear.
Personalausweis wrote:new2:
wrong PW in box O.o
tested it with "testingacc" and he typed secPW from the very last else part -.-
Did you change it like I said? Because the way you had it at first wouldn't have worked.

This

Code: Select all

if a == b or c or d then
is not the same as this

Code: Select all

if a == b or a == c or a == d then

Re: How to open Itemshop...

Posted: Sat Nov 27, 2010 7:50 am
by Personalausweis
i should stop working on such things at 3-5 in the morning -.-

he types the correct PW into the box, but i put the wrong sec PW into the function -.-
as i removed the outcomments he bought the puris.

everything works perfect.


Thanks a lot rock5

Here is the final code:

Function:

Code: Select all

function sec_pw(accname)
if accname == "Testingacc" then
   keyboardType("SecPW");
elseif accname == ("Acc1") or accname == ("Acc2") or accname == ("Acc3") or accname == ("Acc4") or accname == ("Acc5") then
   keyboardType("SecPW");
elseif accname == ("Acc6") or accname == ("Acc7") then
   keyboardType("SecPW");
else
   keyboardType("SecPW");
end;
end
Waypoint:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
    include( "/userfunctions/addon_sec_pw.lua");
    include( "/userfunctions/addon_writetokens.lua");
</onLoad>
	<!-- #  1 --><waypoint x="14" z="40">
		RoMScript("ItemMallFrame:Show()");
		yrest(1000)
		player:mouseclickL(434, 106, 1024, 768);
		yrest(500);
		player:mouseclickL(59, 260, 1024, 768);
		player:mouseclickL(59, 260, 1024, 768);
		yrest(500);
		player:mouseclickL(330, 162, 1024, 768);
		yrest(500);
		accname = RoMScript("GetAccountName();");
		player:mouseclickL(240, 358, 1024, 768);
		yrest(500);
		sec_pw(accname);
		player:mouseclickL(469, 202, 1024, 768);
		write_tokens(); 
		sendMacro("}LoginNextToon=true;a={")
      sendMacro("Logout();"); yrest(60*1000);
		player = CPlayer.new();
		settings.load();
		settings.loadProfile("Daylie");
		yrest (4000)
      loadPaths("itemshop");
	</waypoint>
</waypoints>

one thing should be said:

if you PW contains capital letters, keyboardType() won't work.
I solved it with:

PW: AbcDef

Code: Select all

keyboardPress( key.VK_A, key.VK_SHIFT );
keyboardType("bc");
keyboardPress( key.VK_D, key.VK_SHIFT );
keyboardType("ef");
if you use keyboardType("AbcDef") it writes "acbdef".