-
d003232
- Posts: 1252
- Joined: Wed Jun 03, 2009 4:27 pm
#1141
Post
by d003232 » Thu Jun 25, 2009 4:57 am
kolobok wrote:Is it possible to increase radius of cursor search for resources. Sorry for bad english
At player.lua line 26
Code: Select all
-- Scan rect variables
local scanWidth = 10; -- Width, in 'steps', of the area to scan
local scanHeight = 8; -- Height, in 'steps', of area to scan
local scanXMultiplier = 1.0;
local scanYMultiplier = 1.1;
local scanStepSize = 35; -- Distance, in pixels, between 'steps'
You can make the steps closer by changing 'scanStepSize = 35' to 30 or so and you can make the scan area wider by changing 'scanWidth = 10' to an higher valua. Caution: If you only reduce 'scanStepSize', then you will make the scan area smaller.
-
d003232
- Posts: 1252
- Joined: Wed Jun 03, 2009 4:27 pm
#1143
Post
by d003232 » Thu Jun 25, 2009 11:10 am
markusbab wrote:so any chance do us this points?
I'm using yGather. I just let my bot run a while around the area to collect as much havesting points as possible. After that I create a waypoint file. There seems to be a bug in yGathere with the minimap. Means all yGather points at the minimap are a little wrong placed. Since I know that I can consider that.
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#1144
Post
by Administrator » Thu Jun 25, 2009 8:34 pm
What is the structure of yGather's information in SaveVariables.lua? I'm guessing that it will just be map coordinates instead of world coordinates, but it could still be useful.
-
d003232
- Posts: 1252
- Joined: Wed Jun 03, 2009 4:27 pm
#1145
Post
by d003232 » Fri Jun 26, 2009 1:04 am
Administrator wrote:I'm guessing that it will just be map coordinates instead of world coordinates, but it could still be useful.
Yes, seems so. The data looks like
Code: Select all
yGather_data = {
[2] = {
[35] = {
[7] = {
["y"] = 544,
["x"] = 489,
},
[1] = {
["y"] = 796,
["x"] = 483,
},
[2] = {
["y"] = 764,
["x"] = 504,
},
[4] = {
["y"] = 737,
["x"] = 449,
},
-
3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
#1146
Post
by 3cmSailorfuku » Fri Jun 26, 2009 11:17 am
d003232 wrote:Administrator wrote:I'm guessing that it will just be map coordinates instead of world coordinates, but it could still be useful.
Yes, seems so. The data looks like
Code: Select all
yGather_data = {
[2] = {
[35] = {
[7] = {
["y"] = 544,
["x"] = 489,
},
[1] = {
["y"] = 796,
["x"] = 483,
},
[2] = {
["y"] = 764,
["x"] = 504,
},
[4] = {
["y"] = 737,
["x"] = 449,
},
You could solve this by making for each map a X,Z offset that will be converted by taking the map positions and differ them from the world coordinates. Would be easier though if theres a function in the game that will return world coordinates (In Lua).
-
kolobok
- Posts: 21
- Joined: Sun Jun 14, 2009 4:06 pm
#1147
Post
by kolobok » Fri Jun 26, 2009 4:59 pm
HI! I need to increase moving back and sideways when the bot is stuck so he can move arround biger barrier! Thanks again
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#1148
Post
by Administrator » Fri Jun 26, 2009 8:56 pm
kolobok wrote:HI! I need to increase moving back and sideways when the bot is stuck so he can move arround biger barrier! Thanks again
classes/player.lua line ~695, function CPlayer:unstick().
-
kolobok
- Posts: 21
- Joined: Sun Jun 14, 2009 4:06 pm
#1149
Post
by kolobok » Sat Jun 27, 2009 4:30 am
Another problem
when bot trying to harvest and a mob attacks him it staring to fight the mob and after fighting bot forgets about the unharvested resourses and just moving to the next point. So i need to change the behavior of the bot so after fighting he will move 1 or 2 points to back not forward.
-
d003232
- Posts: 1252
- Joined: Wed Jun 03, 2009 4:27 pm
#1150
Post
by d003232 » Sat Jun 27, 2009 5:42 am
kolobok wrote:Another problem
... to change the behavior of the bot so after fighting he will move 1 or 2 points to back not forward.
That's really a problem ... just joking. I would say there are so much rescoures. I would not worry about.
Ok. I'm harvesting at the moment in the low level area. Pherhaps I would see it different, if I had really to fight to go to a ressource point.
If you go back, there is a greater possibility to get stuck and look bottish. And I don't really understand, why the bot is skipping a waypoint. I think if I look at the coding the bot have first to reach a waypoint to go to the next. Only if you start the bot he will look for the closest one?
-
kolobok
- Posts: 21
- Joined: Sun Jun 14, 2009 4:06 pm
#1151
Post
by kolobok » Sat Jun 27, 2009 9:02 am
How can i make bot scan the area while it`s moving? So it will goes like this:start at one point(scan it) moving to another(always scan the area) stop at the point(scan once again) and so on! Is it possible or not?
-
kolobok
- Posts: 21
- Joined: Sun Jun 14, 2009 4:06 pm
#1152
Post
by kolobok » Sat Jun 27, 2009 9:04 am
Only if you start the bot he will look for the closest one?
Yes he will no matter where i start him.
-
blawa
- Posts: 5
- Joined: Sat Jun 27, 2009 8:54 am
#1153
Post
by blawa » Sat Jun 27, 2009 9:50 am
Did anybody make this work on Ubuntu/Linux?
I set all up in wine, but when i press "del" nothing happens, there isn't even a error message in the console where i run MicroMacro ...
Do I maybe need some additional libraries for wine?
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#1154
Post
by Administrator » Sat Jun 27, 2009 10:14 am
Only if you start the bot he will look for the closest one?
Yes he will no matter where i start him.
Yes, when you start the bot, it automatically starts the waypoints off at the closest waypoint, rather than the first waypoint.
Did anybody make this work on Ubuntu/Linux?
I set all up in wine, but when i press "del" nothing happens, there isn't even a error message in the console where i run MicroMacro ...
Do I maybe need some additional libraries for wine?
I never actually tried this specific script under WINE. I have tested MicroMacro under WINE before, and I don't think I encountered any major problems. I don't think any additional libraries would help. I think the problem is in hotkey detection. MicroMacro uses GetKeyState() to read the key up/down states. I'm not sure, but I think that WINE may have problems with this function. Does the problem persist even when MicroMacro is the foreground window? Can you try changing the hotkey from DELETE to something else (see rom/bot.lua line ~20 for this)?
-
kolobok
- Posts: 21
- Joined: Sun Jun 14, 2009 4:06 pm
#1155
Post
by kolobok » Sat Jun 27, 2009 10:39 am
How can i make bot scan the area while it`s moving? So it will goes like this:start at one point(scan it) moving to another(always scan the area) stop at the point(scan once again) and so on! Is it possible or not?
That`s the main question of mine plz help me
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#1156
Post
by Administrator » Sat Jun 27, 2009 11:59 am
You can't do it while running. If something were found, by the time you enact on it, it would not be in the exact same place on-screen. This means when you try to harvest it, you're going to totally miss it. Plus, the function isn't designed be be used while running. It is only to be used while stopped.
-
blawa
- Posts: 5
- Joined: Sat Jun 27, 2009 8:54 am
#1157
Post
by blawa » Sat Jun 27, 2009 12:32 pm
I never actually tried this specific script under WINE. I have tested MicroMacro under WINE before, and I don't think I encountered any major problems. I don't think any additional libraries would help. I think the problem is in hotkey detection. MicroMacro uses GetKeyState() to read the key up/down states. I'm not sure, but I think that WINE may have problems with this function. Does the problem persist even when MicroMacro is the foreground window? Can you try changing the hotkey from DELETE to something else (see rom/bot.lua line ~20 for this)?
I tried to change both setKeys (line 18,20) but it still didn't work.
Can i maybe make him force the start when the script is called; so that i don't even have to press any key?
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#1158
Post
by Administrator » Sat Jun 27, 2009 12:48 pm
Change startMacro(main) to startMacro(main, true) at the end of bot.lua. I'm going to try looking into this problem and figure out why it's not working properly under WINE. I have no idea how it will act with memory reading, so expect more problems.
EDIT: Yeah, it's a known problem with WINE that is expected to not be fixed any time soon if at all.
-
blawa
- Posts: 5
- Joined: Sat Jun 27, 2009 8:54 am
#1159
Post
by blawa » Sun Jun 28, 2009 5:34 am
Ok he at least now started running.
But can you tell me how to transfer the RoM coordinates to the script coordinates?
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#1160
Post
by Administrator » Sun Jun 28, 2009 9:20 am
Nope. There really is no relevance to the coordinates shown by the mini-map. The only way to get these coordinates, as far as I know, is to use rom/createpath.lua to dump your location. You could, if you wanted to, write a script to just show only your location like this:
Code: Select all
include("classes/player.lua");
function main()
local playerAddress = memoryReadIntPtr(getProc(), staticcharbase_address, charPtr_offset);
player = CPlayer(playerAddress);
while(true) do
printf("\rLocation: (%5d, %5d)", player.X, player.Z);
player:update();
yrest(100);
end
end
startMacro(main);
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests