Page 34 of 46

Re: rock5's "fastLogin Revisited"

Posted: Thu Feb 27, 2014 5:13 pm
by Desmond
Hi How to make the bot after bot 10daily switch to another character is there but how to make the bot as all characters on an account held switch to another account?

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
		local Sender = "Sender"					<!-- Name of Sender -->
		local text = ""		<!-- Message -->
		RoMScript("SendChatMessage(\'"..text.."\', 'ZONE', 0, \'"..Sender.."\');");
		yrest(5000);							<!-- wait time -->
		repeat
			player:target_NPC("")
			CompleteQuestByName("")
			if RoMScript("Daily_count()") == 10 then
                        RoMScript("LeaveParty();");
				ChangeChar()
				loadPaths(__WPL.FileName)
				RoMScript("SendChatMessage(\'"..text.."\', 'ZONE', 0, \'"..Sender.."\');");
				yrest(5000);							<!-- wait time -->
			end
			AcceptQuestByName("")
			yrest(500)							<!-- wait time -->			
		      until false
</onLoad>
</waypoints>

Re: rock5's "fastLogin Revisited"

Posted: Thu Feb 27, 2014 9:59 pm
by masstic1es
So I'm trying to consolidate my code and make it less bulky. Which means having different accounts do different sub tasks in the same run.

Code: Select all

function checkitems()
	tusk = inventory:itemTotalCount(200624)
	claw = inventory:itemTotalCount(200609)
		if getAcc() == {1,2,3} then
			if (5>tusk) then
				__WPL:setWaypointIndex(__WPL:findWaypointTag("boar"))
			else
				__WPL:setWaypointIndex(__WPL:findWaypointTag("dailys"))
			end
		elseif getAcc() == {4,5,6} then
			if (5>claw) then
				__WPL:setWaypointIndex(__WPL:findWaypointTag("bear"))
			else
				__WPL:setWaypointIndex(__WPL:findWaypointTag("dailys"))
			end
		end
end
The problem is maybe i'm not using the getAcc() function right? or maybe its not doing what I want it to? But basically, I need it to check item count, and send off to gather more if it doesn't have enough, otherwise it will start the daily turn in loop. Problem is, all it does is the daily turn in loop. I think its completely glossing over this section and saying nothing applies (which is why I say that I may be using getAcc() wrong)

update:
Apperantly changing

Code: Select all

if getAcc() == {1,2,3} then
with

Code: Select all

if getAcc() == 1 or 2 or 3 then
works

update 2: Nope, I thought it worked til i ran multiple accts through. everyone goes through the first (boar) path

Re: rock5's "fastLogin Revisited"

Posted: Fri Feb 28, 2014 12:41 am
by rock5
Desmond wrote:Hi How to make the bot after bot 10daily switch to another character is there but how to make the bot as all characters on an account held switch to another account?
Just use SetCharList and LoginNextChar as discussed in lots of places and in this topic.
masstic1es wrote:if getAcc() == {1,2,3} then
getAcc returns a number. {1,2,3} is a table. So you are comparing a number to a table. Can't be done.
masstic1es wrote:if getAcc() == 1 or 2 or 3 then
This is wrong. This is the same as saying

Code: Select all

if (getAcc() == 1) or (2) or (3) then
In Lua any value that is not false or nil is treated as true. So (2) and (3) are both seen as true. Which means the whole line will always be true. What you meant was

Code: Select all

if getAcc() == 1 or getAcc() == 2 or getAcc() == 3 then
You can also use table.contains, especially if it's a long list.

Code: Select all

if table.contains({1,2,3},getAcc()) then

Re: rock5's "fastLogin Revisited"

Posted: Fri Feb 28, 2014 12:52 am
by masstic1es
Desmond wrote:Hi How to make the bot after bot 10daily switch to another character is there but how to make the bot as all characters on an account held switch to another account?

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
		local Sender = "Sender"					<!-- Name of Sender -->
		local text = ""		<!-- Message -->
		RoMScript("SendChatMessage(\'"..text.."\', 'ZONE', 0, \'"..Sender.."\');");
		yrest(5000);							<!-- wait time -->
		repeat
			player:target_NPC("")
			CompleteQuestByName("")
			if RoMScript("Daily_count()") == 10 then
                        RoMScript("LeaveParty();");
				ChangeChar()
				loadPaths(__WPL.FileName)
				RoMScript("SendChatMessage(\'"..text.."\', 'ZONE', 0, \'"..Sender.."\');");
				yrest(5000);							<!-- wait time -->
			end
			AcceptQuestByName("")
			yrest(500)							<!-- wait time -->			
		      until false
</onLoad>
</waypoints>

You need to set your char list (see the first post) and than call it with a proc after you daily loop is complete.

Code: Select all

<OnLoad>

<!-- Autologin script -->
function relog()
	SetCharList({{
	{account=1 , chars= {}},
	{account=2 , chars= {}},
	{account=3 , chars= {}},
},{
	{account=4 , chars= {}},
	{account=5 , chars= {}},
	{account=6 , chars= {}},
}})
	LoginNextChar()
	yrest(3000)
	player:update()
	loadProfile()
	loadPaths("waypoint");
end
</OnLoad>

Code: Select all

function checkdaily()
local dailyQuestCount, dailyQuestsPerDay = RoMScript("Daily_count()");
	if dailyQuestsPerDay == dailyQuestCount then
      relog()
	else
		printf("You've done "..dailyQuestCount.." of " .. dailyQuestsPerDay .. " Daily Quests.\n");
	end
end

Re: rock5's "fastLogin Revisited"

Posted: Fri Feb 28, 2014 12:01 pm
by masstic1es
rock5 wrote:
Desmond wrote:Hi How to make the bot after bot 10daily switch to another character is there but how to make the bot as all characters on an account held switch to another account?
Just use SetCharList and LoginNextChar as discussed in lots of places and in this topic.
masstic1es wrote:if getAcc() == {1,2,3} then
getAcc returns a number. {1,2,3} is a table. So you are comparing a number to a table. Can't be done.
masstic1es wrote:if getAcc() == 1 or 2 or 3 then
This is wrong. This is the same as saying

Code: Select all

if (getAcc() == 1) or (2) or (3) then
In Lua any value that is not false or nil is treated as true. So (2) and (3) are both seen as true. Which means the whole line will always be true. What you meant was

Code: Select all

if getAcc() == 1 or getAcc() == 2 or getAcc() == 3 then
You can also use table.contains, especially if it's a long list.

Code: Select all

if table.contains({1,2,3},getAcc()) then
Rock, you rock. :P

worked like a charm!

Re: rock5's "fastLogin Revisited"

Posted: Fri Feb 28, 2014 7:20 pm
by Desmond
SetCharList LoginNextChar And where I must ето insert?

Re: rock5's "fastLogin Revisited"

Posted: Fri Feb 28, 2014 10:37 pm
by rock5
Desmond wrote:SetCharList LoginNextChar And where I must ето insert?
LoginNextChar logs into the next character. So obviously you insert it where you want it to log into the next character.

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 7:44 am
by Desmond
ChangeChar() It costs already well But as to do that did change an account?

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 8:43 am
by Eggman1414
ChangeChar() It costs already well But as to do that did change an account?
Have no idea what that said?

Are you asking will it change accounts?
If so, yes it will. It can change to any character on any account you have set up in the config files.

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 8:44 am
by rock5
Desmond wrote:ChangeChar() It costs already well But as to do that did change an account?
Um... I didn't understand that. Please try again.

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 9:03 am
by Desmond
I am necessary as 8 personages will pass on an account an account was replaced

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 9:30 am
by Eggman1414
Desmond wrote:I am necessary as 8 personages will pass on an account an account was replaced
Ummm what? Post it your own language. Maybe it will be easier to translate...

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 10:26 am
by Desmond
I and through interpreter I translate e

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 8:44 pm
by rock5
I think you are saying you want to change accounts when you finish the characters on the current account. The functions I told you about are the ones you want to use.

Code: Select all

setCharList({
   {account=1 , chars= {1,2,3,4,5,6,7,8}},
   {account=2 , chars= {1,2,3,4,5,6,7,8}},
   {account=3 , chars= {1,2,3,4,5,6,7,8}},
})
loginNextChar()
This example will go through all the characters in account 1, 2 and 3.

Re: rock5's "fastLogin Revisited"

Posted: Sat Mar 01, 2014 9:08 pm
by Desmond
Thank you! so I did
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
local Sender = "Sender" <!-- Name of Sender -->
local text = "об" <!-- Message -->
RoMScript("SendChatMessage(\'"..text.."\', 'ZONE', 0, \'"..Sender.."\');");
yrest(5000); <!-- wait time -->
repeat
player:target_NPC("Отважный Бидер")
CompleteQuestByName("Героическая оборона")
if RoMScript("Daily_count()") == 10 then
RoMScript("LeaveParty();");
SetCharList({
{account=1 , chars= {}},
{account=2 , chars= {}},
{account=3 , chars= {}},
{account=4 , chars= {}},
})

local channel = RoMScript("GetCurrentParallelID()");
if ( 3 > channel) then
channel = channel + 1;
else
channel = 1;
end;
RoMScript("UserSelectedChannel = "..channel)

LoginNextChar();
loadPaths(__WPL.FileName)
RoMScript("SendChatMessage(\'"..text.."\', 'ZONE', 0, \'"..Sender.."\');");
yrest(5000); <!-- wait time -->
end
AcceptQuestByName("Героическая оборона")
yrest(500) <!-- wait time -->
until false
</onLoad>
</waypoints>

Re: rock5's "fastLogin Revisited"

Posted: Sun Mar 02, 2014 7:33 am
by rock5
Please remember to put code in

Code: Select all

 tags.

I think this line wont work.
[quote]RoMScript("UserSelectedChannel = "..channel)[/quote]RoMScript can gets values ok, eg. variable values or values returned from functions but it has problems executing code.

The old way of fixing it is to do it like this
[code]RoMScript("} UserSelectedChannel = "..channel.." a={")
An easier option is to use the RoMCode function which does this for you

Code: Select all

RoMCode("UserSelectedChannel = "..channel)
An even easier solution is to use a function available in the loginnextchar userfunction.

Code: Select all

SetChannelForLogin(channel)

Re: rock5's "fastLogin Revisited"

Posted: Sun Mar 02, 2014 10:01 am
by Desmond
Boat begin to go across not натех personages a тоесть boat is small to pass to 8а пепешел on 3 пожже on 5 that error?

Re: rock5's "fastLogin Revisited"

Posted: Mon Mar 10, 2014 3:27 pm
by 883Dman
Another one kicking my butt. I have a WP file called leave AT. It has my character travel from AT to Sarlo. When they get to sarlo I want them to switch to next character/acct and load the path to get to Malatina in varanas central. Next character line is crashing out. "Failure to load waypoint xxx" where xxx is the line where I call nextchar.

Code: Select all

<!-- #  7 --><waypoint x="-18698" z="-2463" y="821">	
	 SetCharList({ -- example character list
     {account=4, chars= {2,3,6}},   	
     {account=3, chars= {1}},   
    {account=8, chars= {1}},      
 {account=7, chars= {2}}, 
		  
    })
	
    LoginNextChar()
	loadPaths("tominis")
end

	</waypoint>

Re: rock5's "fastLogin Revisited"

Posted: Mon Mar 10, 2014 6:28 pm
by lisa
the end will make it crash as soon as it gets to that waypoint, remove the end and it might work.

Re: rock5's "fastLogin Revisited"

Posted: Mon Mar 10, 2014 6:37 pm
by 883Dman
i've tried with and and without. Same result.