Page 9 of 46

Re: rock5's "fastLogin Revisited"

Posted: Sun Sep 25, 2011 11:01 am
by rock5
I did something like that already elsewhere from before i undated the addon. I'll find it and edit it here.

Something like this maybe. Note: this will only work with latest version of autologin addon or else "fastLoginNumChars" wont be recognised.

Code: Select all

if fastLoginNumChars > CHARACTER_SELECT.selectedIndex then -- Not last character
    sendMacro("}LoginNextToon=true;a={")
    sendMacro("Logout();"); 
    waitForLoadingScreen();
else -- Last character
    local nextAccount
    if LogID == 1 then
        nextAccount = 3
    elseif LogID == 3 then
        nextAccount = 7
    elseif LogId == 7 then
        print("Last account finished for the day")
        player:sleep()
    end

    ChangeChar(1,nextAccount)
    waitForLoadingScreen();
end

Re: rock5's "fastLogin Revisited"

Posted: Sun Sep 25, 2011 11:51 am
by mayainverse
actually i am not sure i can even get this to work. whenever i log onto these accounts for some reason i always get a password failed notice right when logging ing (for secondary pass) this was happening even before i put in fastlogin. even before i enter passwords. i would get this thing pop up. i do not get iton my main account but these alt acounts. really odd.



so this will not work using your fastlogin (one for this thread)?

so your 1 3 7 thing.

you defined these numbers in while configuring the fastlogin stuff in that interface folder of rom? like i have mine for example set to numbers 10-16 so the buttons are somewhat centered on screen.

so it is if it is at character 8 of account that is on space 1 then it logs in account in space 3? then if 8 char account 3 then 7 then stops?

Re: rock5's "fastLogin Revisited"

Posted: Sun Sep 25, 2011 12:45 pm
by rock5
mayainverse wrote:so it is if it is at character 8 of account that is on space 1 then it logs in account in space 3? then if 8 char account 3 then 7 then stops?
That's right. Of course they were just an example. You can use any account numbers. And they don't have to have 8 characters either because it checks the number of characters.

When I get around to creating a function for all this, it will allow you to also pick which characters of which accounts to cycle through.

Re: rock5's "fastLogin Revisited"

Posted: Sun Sep 25, 2011 1:45 pm
by mayainverse
so i can replace your code u just posted with

Code: Select all

endMacro("}LoginNextToon=true;a={")
            sendMacro("Logout();"); yrest(3*60*1000) -- wait 3m for next character to load
                  -- Re-initialize player
              player = CPlayer.new();
              settings.load();
              settings.loadProfile("tiering"); -- Profile name
              yrest (4000)[/color]
         end
with obv with my specs.

or did is it not a part of fastlgin yet. sorry i did not fully understand the way you worded what you said.

Re: rock5's "fastLogin Revisited"

Posted: Sun Sep 25, 2011 9:36 pm
by rock5
You understood correctly. Just replace the "red" text.

Re: rock5's "fastLogin Revisited"

Posted: Mon Sep 26, 2011 1:02 pm
by mayainverse
if logid == 1

this is the character log id 1-8?

it seems there is just no possible way i can get this to work. for some reason whenever i log into these off accouts. first thing i get is password misstry error. this is not the fastlogin or me typing password in fastlogin config wrong. it did this even before. before i put pasword in. first thing that pop up.

so it couldnt get past this so i guess this method wont work for me.

do you know how I can make it print the name of the last character that finished somepalce.

sometimes the client crashes. and takes good 20min trying to find out place it leftoff.

Re: rock5's "fastLogin Revisited"

Posted: Mon Sep 26, 2011 8:20 pm
by rock5
mayainverse wrote:if logid == 1

this is the character log id 1-8?
Nope. I just double checked it. "LogID" is definately the account number. Of course to use it in the bot you need to get it with RoMScript. Forgot that in the example above.
mayainverse wrote:it seems there is just no possible way i can get this to work. for some reason whenever i log into these off accouts. first thing i get is password misstry error. this is not the fastlogin or me typing password in fastlogin config wrong. it did this even before. before i put pasword in. first thing that pop up.
Are you saying you still get the secondary password failure when changing accounts? I think I've mentioned that I still, rarely, sometimes get it myself but it seems to nearly always work. Why yours is failing more, I don't know. Maybe it's because most of my secondary passwords are the same. Nothing I can do about it. Sorry.
mayainverse wrote:do you know how I can make it print the name of the last character that finished somepalce.

sometimes the client crashes. and takes good 20min trying to find out place it leftoff.
The easy way is just to use "logMessage()". This will add your message to the micromacro log file. eg.

Code: Select all

logMessage("Character " .. player.Name .. " finished.")
Or you could create your own log file like lisa does for the "Couse of Terror" waypoint and the "gmmonitor" userfunction.

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 3:20 am
by mayainverse
yea i dont know why it does it. I never get it on my main account. also all my alt accounts have same second pass too. strange but w/e. I am usualy at my computer and swaping to next account every 1 and half hours is not a big deal. ill try out your reporting method when servers are back up.

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 4:09 am
by yoyodoggg
well guess i posted this on the wrong thread, mybad.
i am using the correct file thou, so if you have a second could you please try this code out and let me know why it wont work
just copying and pasting my post from other thread since info was all correct but got no attention since i fail at posting.

rock5, sorry to bother u again but im still having no luck using this code
everything should be romscript'd that needs to be, for some reason printf(LogID) just gives me a 0 when i added it to a few lines so maybe its not a global var?

anyways here is my error and my code,
RoM windows size is 800x601, upper left corner at 4,30
Loading profile userdefault.xml
MACRO Test: ok
Ranged skill found: PRIEST_RISING_TIDE
[DEBUG] CPU Frequency 3579.545
Loaded waypoint path token.xml
No return path with default naming token_return.xml found.
We use the normal waypoint path token.xml now.
We changed the option 'COMBAT_DISTANCE' from '120' to '50'.
We changed the option 'COMBAT_RANGED_PULL' from 'true' to 'false'.
Moving to waypoint #1, (-614, -5816)
Your done 0 of 10
Not enough Sharp Bear Claw!
Not enough Boar Tusks!
CharacterName = ### Needs more Daily Items.. Im all out
7:33pm - [string "..."]:62: attempt to compare nil with number

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<OnLoad>
<!-- Invetory update. Are you full bags
		player:update()
		inventory:update();
		if(1 > inventory:itemTotalCount(0) ) then
			printf("Error. Not enough BagSpase. Clean Bag and Start again.");
			nextplease()
		end-->

-- Settings
	local goldeggs = inventory:itemTotalCount(204792)
	local bearclaw = inventory:itemTotalCount(200609)
	local boartusk = inventory:itemTotalCount(200624)
	local goodcake = inventory:itemTotalCount(204791)
<!--	local nobearclaw = "0"
	local noboartusk = "0"-->
	changeProfileOption("COMBAT_DISTANCE", 50)
	changeProfileOption("COMBAT_RANGED_PULL", false)
	
-- Are you Prob not in zone
	if player.Level > 50 then
	printf("This character probably Is Not in zone going to next!\n");
	sendMacro("}LoginNextToon=true;a={")
        sendMacro("Logout();");
        waitForLoadingScreen();
        loadPaths("token");
	end
	
<!-- Were you just a Farmer, do you have golden eggs to mail -->
 function eggchecks()
	<!--if goldeggs ~= 0 then
	 printf("I have Golden Eggs to Dump!\n");
	 loadPaths("maildump");
	end-->
 end
 		
<!-- Are you out of daily items -->
function dailyitemz()
		if 5>bearclaw then
		 nobearclaw = "1"
			printf("Not enough Sharp Bear Claw!\n");
		end
		if 5>boartusk then
		noboartusk = "1"
			printf("Not enough Boar Tusks!\n");
		end
		if 5>bearclaw and 5>boartusk then 
			printf("CharacterName = "..player.Name.. " Needs more Daily Items.. Im all out\n");
			nextplease()
		<!--Single accout logout
		sendMacro("}LoginNextToon=true;a={")
        sendMacro("Logout();");
        waitForLoadingScreen();
        loadPaths("token"); -->
		end
end	
		
function checkDQCount()
local dailyQuestCount, dailyQuestsPerDay = RoMScript("Daily_count()");
	-- Use a daily ticket
	<!--if dailyQuestsPerDay - dailyQuestCount == 0 then
	local reset = inventory:findItem(202434)
		if reset then
			reset:use()
		end
	end-->
	if 10 == dailyQuestCount  then
    		printf ("You did "..dailyQuestCount.." of " .. dailyQuestsPerDay ..    " All Done Stop\n"); 
			printf("CharacterName = "..player.Name.."\n");
				
		else
			printf("Your done "..dailyQuestCount.." of " .. dailyQuestsPerDay ..    "\n");
     end
end


<!-- Multi accout code -->
function nextplease()
	local numChars = RoMScript("fastLoginNumChars")
	local selectIndex = RoMScript("CHARACTER_SELECT.selectedIndex")
	if numChars > selectIndex then 
		print("Loading next character on this account")
		sendMacro("}LoginNextToon=true a={")
		sendMacro("Logout()")
		waitForLoadingScreen()
	else
    local nextAccount
    if LogID == 1 then
        nextAccount = 5
		print("Loading Account 5")
    elseif LogID == 2 then
        nextAccount = 4
        print("Loading Account 4")
    end
		printf("Switching now")
		RoMScript("ChangeChar(1,nextAccount)")
		waitForLoadingScreen();
		sendMacro("}fastLoginRelog=false;a={")
	end
	yrest (4000)
	loadPaths("token");
end
</OnLoad>
	
	<!-- #  1 --><waypoint x="-613" z="-5812" y="24">
		checkDQCount();
		yrest(1000);
		dailyitemz();	
		yrest(1000);
		
		<!--Get quests -->
		player:target_Object(110584); yrest(1000);
		AcceptQuestByName("Collect Boar Tusks")
		player:target_Object(110584); yrest(1000);
		AcceptQuestByName("Sharp Bear Claw")
	</waypoint>
	<!-- #  6 --><waypoint x="-604" z="-5884" y="25">	
		if noboartusk == 1 then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("noboarskipit"))
		end
	</waypoint>
	<!-- #  7 --><waypoint x="-627" z="-5957" y="26" >	</waypoint>
	<!-- #  8 --><waypoint x="-654" z="-6022" y="28">	
		player:target_NPC("Del"); yrest(1000);
		CompleteQuestByName("Collect Boar Tusks"); yrest(1000);
		<!--checkDQCount();
		dailyitemz();
		player:update(); -->
		if nobearclaw == "1" then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("nobearskipit"))
		end
	</waypoint>
	<!-- # 11 --><waypoint x="-657" z="-6089" y="21">	</waypoint>
	<!-- # 12 --><waypoint x="-575" z="-6101" y="19" tag="noboarskipit">		
		player:target_NPC("Cid");
		sendMacro("OnClick_QuestListButton(3, 1)"); yrest(1000);
		sendMacro("CompleteQuest()"); yrest(1000); 
		 <!--CompleteQuestByName("Sharp Bear Claw") -->
		</waypoint>
	<!-- # 15 --><waypoint x="-517" z="-6058" y="22" tag="nobearskipit">	</waypoint>
	<!-- # 16 --><waypoint x="-550" z="-5949" y="24">	
	 <!-- eggchecks()-->
	if( math.random(100) > 60 ) then -- jump 40% of the time
		keyboardPress(key.VK_UP);
		keyboardPress(key.VK_SPACE);
		keyboardPress(key.VK_UP);
	end
	</waypoint>
</waypoints>
let me know if anyone has any suggestions other then getting the account switch to work.

anything i try thou i cant get it to switch accounts. i am using the latest .zip on the frontpage.

i am also not sure when player:update() inventory:update(); checkDQCount(); would all need to be callled, afew are edited out atm
as i have been trying to figure out why the bot doesnt like the account switching code.

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 4:31 am
by mayainverse
wow complicated script >.> why do you have gold eggs and daily quests in a waypoint together though I do not get the point.

I do not really understand the
if accout = 1 then nextloging = 5

i mean then if u cycle through chars on 1 account. when its done with first character will it still go 5th account.
cause there is no information given to bot when exactly to switch. it just says "if im on account one then I should log on account 5 instead".

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 4:48 am
by yoyodoggg
Plan was to eventually make the script load a 2nd waypoint which would run to the mailbox and unload any goldeggs if found in inventory.

But I cant even get the <!-- Multi accout code --> to work.
from ur above post seems i need to Romscript the LogID as well or something?
seems we keep missing something in the code, im surprised none have one they can copy and paste.

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 5:20 am
by rock5
mayainverse wrote:I do not really understand the
if accout = 1 then nextloging = 5

i mean then if u cycle through chars on 1 account. when its done with first character will it still go 5th account.
No, it says.

If the total number of characters on this account is more than the current character (ie. not the last) then
  • login next character
else (ie last character)
  • if accout = 1 then nextloging = 5
    etc
end

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 5:42 am
by rock5
yoyodoggg wrote:from ur above post seems i need to Romscript the LogID as well or something?
Yes try that. You can just add

Code: Select all

   local LogID = RoMScript("LogID")
next to

Code: Select all

   local numChars = RoMScript("fastLoginNumChars")
   local selectIndex = RoMScript("CHARACTER_SELECT.selectedIndex")
yoyodoggg wrote:im surprised none have one they can copy and paste
Well not everything was available until recently so probably no one has done it yet.

Like I said, I will eventually create a handy userfunction to do this.

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 5:59 am
by yoyodoggg
eh sorry man didnt mean to make it sound like that. Just some of the other posts i seem are find are a few months old, but none seem to post their working finished script codes for the opensource bot heh. Your work is awesome man, got nothing but love here.

other question i had was about player = CPlayer.new(), player:update() and inventory:update() , not to sure what each do
but im assuming i should do a player update when i first load each character, an inventory update when i run any checks on my bags?
and i assume i can leave CPlayer.new() out now since we havnt used it

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 8:16 am
by yoyodoggg
naw still no luck after making LogID local in the waypoint. pretty sure its global in the .lua isnt it .. shrug

the

Code: Select all

 if numChars > selectIndex then 
line wasnt working at all for me, bot would run from character 1 to char 8 then back to 1 again and then finally get stuck on character 2 and relog him in and out until i finally manuely stop the bot... no idea why

so i change that line and now it triggers. and i at least make it to the

Code: Select all

printf("Switching now\n");
but then it just logs back into character 1 of the same account.. im /boogled.
ive tryed it from both Account1 and Account8, loggin in the last character and then starting the bot. still goes to 1st one on that account. and then it logs the 2nd character on that account in and out repeatly.
I really dont think the nextAccount is getting set right, or the LogID isnt right. i assume LogID = 1 = Account1 in .lua

Code: Select all

<!-- Multi accout code -->
function nextplease()
	local LogID = RoMScript("LogID")
	local numChars = RoMScript("fastLoginNumChars")
	local selectIndex = RoMScript("CHARACTER_SELECT.selectedIndex")
	<!-- local nextAccount = 0 -->
	if numChars - selectIndex ~= 0 then 
		printf("Loading next character on this account\n");
		sendMacro("}LoginNextToon=true a={");
		sendMacro("Logout()");
		waitForLoadingScreen();
	else
    if LogID == 1 then
        nextAccount = 5
		printf("Loading Account 5");
    elseif LogID == 5 then
        nextAccount = 8
        printf("Loading Account 8");
	elseif LogID == 8 then
        nextAccount = 7
        printf("Loading Account 7");
	elseif LogID == 7 then
        nextAccount = 4
        printf("Loading Account 4");
	elseif LogID == 4 then
        nextAccount = 3
        printf("Loading Account 3");
    end
		printf("Switching now\n");
		RoMScript("ChangeChar(1,nextAccount)");
		waitForLoadingScreen();
		sendMacro("}fastLoginRelog=false;a={");
	end
	yrest (4000)
	loadPaths("token");
end

Re: rock5's "fastLogin Revisited"

Posted: Tue Sep 27, 2011 9:18 am
by rock5
This is wrong.

Code: Select all

RoMScript("ChangeChar(1,nextAccount)");
This sends "ChangeChar(1,nextAccount)" into the game but nextAccount has no value there so it becomes

Code: Select all

ChangeChar(1,nil)
in the game.

What you want to send is the value that is stored in nextAccount. Try this.

Code: Select all

RoMScript("ChangeChar(1," .. nextAccount .. ")");

Re: rock5's "fastLogin Revisited"

Posted: Wed Sep 28, 2011 4:49 am
by fuclo
I need some help. I try to set up a script which cycles through about 15 accounts and buys diamonds on each. Autologin works fine and the script I made too, but I don't know what to do after "sendMacro("Logout();"); yrest(1*60*1000)". I tried some of the commands from this thread but none of them worked. Any idea?

Re: rock5's "fastLogin Revisited"

Posted: Wed Sep 28, 2011 5:50 am
by rock5
Don't use "yrest(1*60*1000)", use "waitForLoadingScreen()".

Are you talking about buying diamonds from the npcs?

Re: rock5's "fastLogin Revisited"

Posted: Wed Sep 28, 2011 5:52 am
by fuclo
yes. these days its hard to find a seller and if someone sells them the price is about 25-30k each on my server.

Re: rock5's "fastLogin Revisited"

Posted: Wed Sep 28, 2011 7:18 am
by rock5
You should be able to just use

Code: Select all

player:target_NPC("npcname")
to open the npc dialog

and

Code: Select all

RoMScript("ChoiceOption(x)")
to choose the options.