Page 1 of 1

Function changechar doesn't work

Posted: Wed May 06, 2020 7:41 am
by lolilol666
Hello everyone,


I created a script that works well from start to end.
When I added the section onload below,I got the same thing at this post :
viewtopic.php?f=21&t=5782&hilit=grow&start=20

I got this :

Code: Select all

Loaded waypoint path drill.xml
No return path with default naming drill_return.xml found.
We use the normal waypoint path drill.xml now.

I downloaded the 2 files from Rock5 but they are too old.

The add on my waypoints :

Code: Select all

<onload>
	When_Finished = "relog"
	function checkRelog()
		if When_Finished == "relog" then
			ChangeChar()
			yrest(3000)
			player:update
			loadPaths(__WPL.FileName);
		end
	end
</onload>
I don't have loginxml installed on my folder interface.
I think he is too old with the new gamforge client but I can be wrong, I didn't find a post on this subject.

I use the function in this topic :
I want that once the script is finished, the character log off and the next one log in by launching the same waypoint.

Does anyone have this function that works and who can share it with me please?

best regards,

Re: Function changechar doesn't work

Posted: Thu May 07, 2020 1:53 am
by Onche
Hey,

I can be wrong but to me GF Client works like an external login software that replace your 1st password with a random key that only the GF Client knows. This is the way they force you to use that it.
However, if you didn't link any account to the software, it is possible to do the game updates through the GF Client with an empty account and then log with the NoCheckVersion client (This is what I'm doing).

Now considering this, my answer about your issue would be :

1. If you want to log into another char from another account, and those accounts are linked to your GF Client, then you'll not be able to log the next char even with the loginxml installed.
2. If you want to log into another char from another account, and those accounts are not linked to your GF Client (which means that you still run NoCheckVersion), then you'll be able to log the next char but you'll need your loginxml installed.
3. If you want to log into another char from the same account, and those accounts are linked to your GF Client, then there has to be a way to solve your issue because you can manually go from one char to another without using the GF Client. But maybe tweaking the LoginNextChar userfuntion is required.
4. If you want to log into another char from the same account, and those accounts are not linked to your GF Client (which means that you still run NoCheckVersion), then you'll be able to log the next char but you'll need your loginxml installed.


Seeing "drill.xml" I assume you're farming drillground. If you don't need to do it on main chars, I highly suggest you to find accounts that are not linked to your GF Client and use the loginxml/NoCheckVersion. It should work

Re: Function changechar doesn't work

Posted: Thu May 07, 2020 3:57 am
by lolilol666
Hello Onche,

Thank's you for your repply !


In the cases listed, I am at point 3. As you say, it needs tweaking, but I clearly don't have the skills to do it.

If people have time to watch, I thank them in advance.


in your case, do you have scripts which ask for the connection of the next character and which works?

I don't have an account that is not linked. is it possible to create one or is it too late?

Re: Function changechar doesn't work

Posted: Fri May 08, 2020 3:29 am
by Onche
For now I don't know how to solve the point 3. Tried different things, nothing worked.

But if somehow you find an account that is not linked to the GF client then this kind of loginnextchar waypoint works

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
    <onLoad>
    
	function relog()
        SetCharList({{
			{account=16 , chars= { 1 }},
			{account=17 , chars= { 1 }},
			{account=18 , chars= { 1 }},
			{account=19 , chars= { 1 }},
			{account=20 , chars= { 1 }},
        }})
        LoginNextChar()
        loadProfile()
        loadPaths("Relog.xml");
      end
	  
	  relog();
	  
    </onLoad>
	
</waypoints>
Its just a waypoint to relog the char listed, but if you make a new waypoint you can just change the numbers and put relog(); at the end of your script

Re: Function changechar doesn't work

Posted: Fri May 08, 2020 6:03 am
by lolilol666
Unfortunately, I do not have an unbound account.

If anyone can try to make point 3 work, I thank them :)

Re: Function changechar doesn't work

Posted: Tue May 12, 2020 5:04 am
by lolilol666
Little update :

I remove userfunction Gotoguild.

Now : i get this :
2020-05-11 07:11:18 - C:\Users\Admin\Desktop\mai\scripts\rom\/bot.lua:1001: Failed to compile and run Lua code for waypoint #1

To call the function checkrelog, I put this between waypoints:

When_Finished == "relog";


It's ok or there is a bad thing / miss something ?

Re: Function changechar doesn't work

Posted: Sat May 16, 2020 11:34 am
by Administrator
I'm noticing that you did not have parenthesis on the function call to player:update(). Simple modification:

Code: Select all

<onload>
	When_Finished = "relog"
	function checkRelog()
		if When_Finished == "relog" then
			ChangeChar()
			yrest(3000)
			player:update()
			loadPaths(__WPL.FileName);
		end
	end
</onload>

Re: Function changechar doesn't work

Posted: Sun May 17, 2020 8:47 am
by lolilol666
Hello,

I also added them, but i got the same error.

Re: Function changechar doesn't work

Posted: Sun May 17, 2020 10:33 am
by Administrator
I think you might have put it inside of the first waypoint instead of outside. It should look like this:
Annotation 2020-05-17 103324.png

Re: Function changechar doesn't work

Posted: Mon May 18, 2020 5:45 am
by lolilol666
Hello,

I modified as shown in the screenshot, I still have the message at the end ( but my bot running all the wapyoint #1-#35, it' stop when I call the function):
2020-05-18 12:40:07 - C:\Users\Admin\Desktop\mai\scripts\rom\/bot.lua:1001: Failed to compile and run Lua code for waypoint #1


The only thing I'm not sure is how to call the function

my last waypoint is :

<waypoint

When_Finished == "relog";
</waypoint>


I can't put the all code, i got an error when a I want submit, so there is no x="38" z="28" y="0">


is it correct?


best regards,

Re: Function changechar doesn't work

Posted: Mon May 18, 2020 8:15 am
by Administrator
Would you be willing to post the file so I can take a look at it? Alternatively, you can PM it to me.

Re: Function changechar doesn't work

Posted: Mon May 18, 2020 2:12 pm
by Administrator
I did some investigation and it looks like the developers have completely stripped the Lua functions out of the game that the bot relied on to change characters.

Unfortunately that means that at this time this will not work and cannot be made to work.