CPU freq.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
Those changes are not causing additional problems, it is just that they aren't causing any errors in themselves.
The issue here is just that your computer is having issues handling so much going on at once. If anything causes even the slightest hiccup, that causes the memory reads to be delayed, which then result in the RoMbot erroring out as it cannot access the game's memory. The only way to get around that is to patch every memory read so it continues to retry until it goes through.
The issue here is just that your computer is having issues handling so much going on at once. If anything causes even the slightest hiccup, that causes the memory reads to be delayed, which then result in the RoMbot erroring out as it cannot access the game's memory. The only way to get around that is to patch every memory read so it continues to retry until it goes through.
Re: CPU freq.
I put in code to test for the memory read problem even if i loop it 15 times checking I get the exact same results.
I was thinking about it this am and I am running my machines in energy saver mode much like the way a laptop runs. These cpu's will vary from 1 to 8 cores and may vary speeds also to keep heat down and save energy. I think they change frequency also to achieve this.
local tmp -- just does not work I had to remove it.
I tried to create a test program but the bot does not seem to be able to click leave in drill ground.
The bot is unable to select the leave option on these path.
needle drill
rescue trial
first aid training
mass barrage
I create a test wp with some that worked. This only fails now and then.
I was thinking about it this am and I am running my machines in energy saver mode much like the way a laptop runs. These cpu's will vary from 1 to 8 cores and may vary speeds also to keep heat down and save energy. I think they change frequency also to achieve this.
local tmp -- just does not work I had to remove it.
I tried to create a test program but the bot does not seem to be able to click leave in drill ground.
The bot is unable to select the leave option on these path.
needle drill
rescue trial
first aid training
mass barrage
I create a test wp with some that worked. This only fails now and then.
- Attachments
-
- find the bug test.xml
- (3.78 KiB) Downloaded 266 times
Last edited by beanybabe on Thu Sep 03, 2015 6:10 pm, edited 1 time in total.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
I haven't even had a copy of the game in years. I'm sure someone else would be able to help you out though.
Re: CPU freq.
the following changes let it work for hour or more usualy before a problem. running a regular loop waypoint killing mobs is not affected by this.
i think it can be made to work if there is way to get a adjustment number for the cpu speed. untill a better way is found/
These are the code changes I am using beside the skills with I did not list.
player.lua
887 skill.LastCastTime = skill.LastCastTime + (remaining*1000 * bot.GetTimeFrequency)
memorytable.lua
213 return name .. memoryReadRepeat("string", proc, nameaddress)
bot.lua
326 local freqadj = 1234 --need way to get this number based on cpu speed somewhere i listed how to get the number i use.
--local freqadj = 1000 --origianl number
if( getTimerFrequency ) then
-- Grab the real frequency instead of calculating it, if available
bot.GetTimeFrequency = getTimerFrequency().low / freqadj;
else
-- calculate the CPU Frequency / used for manipulation the GetTime() values
local calc_start = getTime();
yrest(freqadj);
local calc_end = getTime();
bot.GetTimeFrequency = (calc_end.low - calc_start.low) / freqadj;
end
i think it can be made to work if there is way to get a adjustment number for the cpu speed. untill a better way is found/
These are the code changes I am using beside the skills with I did not list.
player.lua
887 skill.LastCastTime = skill.LastCastTime + (remaining*1000 * bot.GetTimeFrequency)
memorytable.lua
213 return name .. memoryReadRepeat("string", proc, nameaddress)
bot.lua
326 local freqadj = 1234 --need way to get this number based on cpu speed somewhere i listed how to get the number i use.
--local freqadj = 1000 --origianl number
if( getTimerFrequency ) then
-- Grab the real frequency instead of calculating it, if available
bot.GetTimeFrequency = getTimerFrequency().low / freqadj;
else
-- calculate the CPU Frequency / used for manipulation the GetTime() values
local calc_start = getTime();
yrest(freqadj);
local calc_end = getTime();
bot.GetTimeFrequency = (calc_end.low - calc_start.low) / freqadj;
end
Re: CPU freq.
this return the cpu speed if there is a way to put it in the batch file and send variable to bot.lua that can be a temp fix.
wmic cpu get MaxClockSpeed
I found this to try setting affinity to only 1 cpu for the bot im going to try that next.
START /affinity 1 ../../micromacro.exe "%~dp0/bot.lua"
wmic cpu get MaxClockSpeed
I found this to try setting affinity to only 1 cpu for the bot im going to try that next.
START /affinity 1 ../../micromacro.exe "%~dp0/bot.lua"
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
No need for a batch script.
After running that code, maxClockSpeed will contain the number returned by that system command.
Code: Select all
local szMaxClockSpeed = system("wmic cpu get MaxClockSpeed");
local parts = explode(szMaxClockSpeed, "\n");
maxClockSpeed = tonumber(parts[2]);
print("Clock speed:", maxClockSpeed);
Re: CPU freq.
I got mixed up trying to figure a formula and just went with the following and replaced all other timing code to test it.
Ran it for few hours it seems best way i tried so far. Need others to test it with dual core and quad core cpus and amd
Ran it for few hours it seems best way i tried so far. Need others to test it with dual core and quad core cpus and amd
Code: Select all
if( getTimerFrequency ) then
local szMaxClockSpeed = system("wmic cpu get MaxClockSpeed");
local parts = explode(szMaxClockSpeed, "\n");
maxClockSpeed = tonumber(parts[2]);
print("Clock speed:", maxClockSpeed);
bot.GetTimeFrequency = maxClockSpeed
else
-- calculate the CPU Frequency / used for manipulation the GetTime() values
local calc_start = getTime();
yrest(1000);
local calc_end = getTime();
bot.GetTimeFrequency = (calc_end.low - calc_start.low) / 1000;
end
Re: CPU freq.
What does this cpu fequency thing do actually when it worked sort of Thursday and Friday but Saturday it just fails.
Then I thought what if number is double the cpu frequency. That makes it fail more.
So I thought what if i set the frequency to 1, it still works with it at 1. Could there be some thing wrong later in the code or does this just not do what is supposed to do?
maxClockSpeed=1
or original bot code bot.GetTimeFrequency =1
Then I thought what if number is double the cpu frequency. That makes it fail more.
So I thought what if i set the frequency to 1, it still works with it at 1. Could there be some thing wrong later in the code or does this just not do what is supposed to do?
maxClockSpeed=1
or original bot code bot.GetTimeFrequency =1
Code: Select all
--- bot.lua
bot.GetTimeFrequency = maxClockSpeed
printf("[DEBUG] CPU Frequency %s\n", bot.GetTimeFrequency);
--- player.lua
--skill.LastCastTime.low = skill.LastCastTime.low + casttime*1000 * bot.GetTimeFrequency;
skill.LastCastTime = skill.LastCastTime + (casttime*1000 * bot.GetTimeFrequency);
--skill.LastCastTime.low = skill.LastCastTime.low +remaining*1000 * bot.GetTimeFrequency
--skill.LastCastTime = skill.LastCastTime + (casttime*1000 * bot.GetTimeFrequency);
skill.LastCastTime = skill.LastCastTime + (remaining*1000 * bot.GetTimeFrequency)
-- skill.lua
--self.LastCastTime.low = self.LastCastTime.low + self.CastTime*1000 * bot.GetTimeFrequency;
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
It looks like it should wait a little bit longer on the skill cast times for slower computers. That's all. That's why I had repeatedly stated that changing the frequency variable won't cause nor fix the errors you're experiencing but could only change the timing when they occur (in those random specific cases when there's a memory read error related to those skills; it wouldn't affect anything else).beanybabe wrote:What does this cpu fequency thing do
Re: CPU freq.
I have used some loot ad ons one named lootit it seems to have some kind of timing that is tied back to the server some how. when rom patches the server it affects that timing. some months it works like a dream and others it hesitates a minute or more before doing its thing. I wonder if this also affects the boss in some way. reading the code it seems timinig affects spell casting and some movements. I just puzzles me how it works so good for hours then just starts having random problems. I have been trying to locate some common varable that affects it. im starting to agree with what you say that timing does not seem to be the main cause of what is happening.
I was reading thru the code and came across this line that is not making sense. this is in player.lua line 886 or so.
local left,casttime = self:getRemainingCastTime()
what is with the left and comma before casttime is some way to link the word left to casttime for a left movement
the older machine with older windows seems to have the most problem.
I was reading thru the code and came across this line that is not making sense. this is in player.lua line 886 or so.
local left,casttime = self:getRemainingCastTime()
what is with the left and comma before casttime is some way to link the word left to casttime for a left movement
the older machine with older windows seems to have the most problem.
Re: CPU freq.
Im done chasing down this timing for now.
This seems to be very complicated from all I have read . Each cpu has its own way of doing timing and even revisions of similar cpus can vary. There would almost have to be some function that constantly monitored the cpu speed every few seconds and kept updating the variable. As the energy features and cpu speed throttling and core switching all affect it and are changing dynamically. the original code you had seems to work ok but for the newest cpus there needs to be some kind of change. i hope in bot 2 you can solve this.
This seems to be very complicated from all I have read . Each cpu has its own way of doing timing and even revisions of similar cpus can vary. There would almost have to be some function that constantly monitored the cpu speed every few seconds and kept updating the variable. As the energy features and cpu speed throttling and core switching all affect it and are changing dynamically. the original code you had seems to work ok but for the newest cpus there needs to be some kind of change. i hope in bot 2 you can solve this.
Re: CPU freq.
Windows Problem Reporting
I keep noticing the bot will come up with a list of invalid id's when started now and then. It seems to happen with the windows focus.
I noticed the machine I have the most problems with is also showing repeating error on some device. Could the program focus be changing now and then and causing these seemingly random nil errors.
here is a ms forum article on it http://answers.microsoft.com/en-us/wind ... 798?page=1
I keep noticing the bot will come up with a list of invalid id's when started now and then. It seems to happen with the windows focus.
I noticed the machine I have the most problems with is also showing repeating error on some device. Could the program focus be changing now and then and causing these seemingly random nil errors.
here is a ms forum article on it http://answers.microsoft.com/en-us/wind ... 798?page=1
Re: CPU freq.
Functions can return 1 or more values. "left,castime" means that it expects 2 values to be returned from the function. The first value will be put in the first variable "left" and the second value will be put in the second variable "casttime".beanybabe wrote: I was reading thru the code and came across this line that is not making sense. this is in player.lua line 886 or so.
local left,casttime = self:getRemainingCastTime()
what is with the left and comma before casttime is some way to link the word left to casttime for a left movement
You may have noticed that self:getRemainingCastTime() is used on it's own in evaluations elsewhere in the file, eg
Code: Select all
if self:getRemainingCastTime() <= prior/1000 then
Code: Select all
local left,casttime = self:getRemainingCastTime()
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: CPU freq.
I still suspecting a timing problem but this one is just a slight difference that happens over time. I run a ping test for 5000 tries and totaled up the count of each ping into an array.
You would think I would get lots of different pings, most of the ping landed on 2 numbers they are 16 apart which is why I suspect a problem.
ping = 77 total= 0
ping = 78 total= 2253
ping = 79 total= 0
...
ping = 93 total= 0
ping = 94 total= 2747
ping = 95 total= 0
getPing seems to be calling macro.cpp in micromacro I just do not see what would cause half the numbers to be 16 different.
You would think I would get lots of different pings, most of the ping landed on 2 numbers they are 16 apart which is why I suspect a problem.
ping = 77 total= 0
ping = 78 total= 2253
ping = 79 total= 0
...
ping = 93 total= 0
ping = 94 total= 2747
ping = 95 total= 0
getPing seems to be calling macro.cpp in micromacro I just do not see what would cause half the numbers to be 16 different.
Re: CPU freq.
sometimes it gives pings in groups like this.
ping = 78 total= 1890
ping = 79 total= 602
ping = 80 total= 0
ping = 92 total= 0
ping = 93 total= 945
ping = 94 total= 1563
I will attach the latest ping it takes like 1 minutes to run.
ping = 78 total= 1890
ping = 79 total= 602
ping = 80 total= 0
ping = 92 total= 0
ping = 93 total= 945
ping = 94 total= 1563
I will attach the latest ping it takes like 1 minutes to run.
- Attachments
-
- ping test b.xml
- (480 Bytes) Downloaded 261 times
Re: CPU freq.
here is a graph of the pings it looks very suspect.
[img] [/img]
[img] [/img]
Re: CPU freq.
ok after looking at it that graph is normal. I just have a feeling something is off ill keep looking.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
Took a look at the code you provided. What you've described is strange. I would first try to confirm that the data being read is accurate. That is, ensure that the result of getPing() is actually returning your ping rather than some junk data. Since it is just doing a memory read to get this data, it's certainly possible that the memory location is just wrong.
Re: CPU freq.
I did get ping in the bot and I did a call to the games function that does the same thing it was strange the numbers were different. I have not got back to figuring why yet. what is really strange is if you capture the ping for 5 minutes then graph it. its like a mountain range.
Who is online
Users browsing this forum: Ahrefs [Bot] and 7 guests