CPU freq.
Re: CPU freq.
I upgraded everything on pc today also found some bugs with Kaspersky online scanner. I am going to try it back to default and see if it works again.
Re: CPU freq.
I am still convinced there is something off in the timing. When some errors happen if I add prints to try to catch them they stop. The prints add enough delay to stop the error it seems. Many errors start to happen during increasing user activity.
its like following bread crumbs with a steam roller all I get is more crumbs.
its like following bread crumbs with a steam roller all I get is more crumbs.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
You could try increasing the number of attempts that it will try to read the memory, or insert a small delay in between them.
Re: CPU freq.
I tried the attempts but the memory the values always print as the same. When I add prints to see the values it seems to work ok. Its just a feeling I get since there seems to be no way to test what is going on I have found yet. These memory problems in rom create so many errors it takes some magic to know what is real.
Some code seems to cause some errors i'm still trying to narrow down which. I noticed this on nearly identical wp.
Some code seems to cause some errors i'm still trying to narrow down which. I noticed this on nearly identical wp.
Re: CPU freq.
Still having problems with this. I have another multicore cpu and rombot is saying the cpu is almost 9ghz with its foumula i had to change the devisor to nearly 4000 to get the bot not to crash. Here is how I changed the rombot to make it easier to fix. I hope someone can figure a way to auto calc the correct number for local FreqAdj
With one cpu I have to lower it to 980 with another I have to change it to 3780 they are both same cpu but different revisions. if i get the freq to show the same as what windows reports it seems to run ok.
Here is some info it may help, its a little over my head. http://tdistler.com/2010/06/27/high-per ... ux-windows
With one cpu I have to lower it to 980 with another I have to change it to 3780 they are both same cpu but different revisions. if i get the freq to show the same as what windows reports it seems to run ok.
Code: Select all
ReportedCpuFreq = -- put your windows cpu freq that shows on computer here in mhz eg 3000 for 3ghs 1 ghz = 1000 mhz
FreqAdj = ReportedCpuFreq /getTimerFrequency().low
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
On Windows, QueryPerformanceFrequency() and QueryPerformanceCounter() are the obvious choice. QueryPerformanceFrequency() returns (surprise!) the frequency of the counter. QueryPerformanceCounter() returns the current value of the counter. Just like CLOCK_MONOTONIC on Linux, the Windows performance counter is a high-frequency, stable, monotonically-increasing counter.
The methods are defined in windows.h. The prototypes are:
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency);
BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
Windows Timing Errata
Note: The follow items do NOT affect the resolution of the Window’s performance counter, but I think it’s still important to know when doing timing on Windows.
One problem you may run into on Windows is that the default system clock interval defaults to 10 or 15ms (depending of the OS version). This clock is what drives all the timers and sleep functions for that platform. What this means is that, left to the default, your timers will trigger 5 to 7.5ms late, on average.
You can fix this by increasing the system clock resolution to 2ms (I remember reading a tech article by Microsoft saying that 2ms gave better system performance than 1ms, but I can’t find it for the life of me). You do this by using the timeGetDevCaps(), timeBeginPeriod() and timeEndPeriod(). Sample code can be found HERE. You have to include mmsystem.h and link against Winmm.lib.
I feel it necessary to note that increasing the system clock interval negatively affects power consumption. The Windows 7 blog as an interesting breakdown of “Windows 7 Energy Efficiency”. Specifically, they noticed a 10% drop in battery life when the clock resolution was set to 1ms using timeBeginPeriod().
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
Code: Select all
bot.GetTimeFrequency = getTimerFrequency().low / 1000;
But, this in itself does not cause an issue. The calculated frequency is then put to use here:
Code: Select all
skill.LastCastTime.low = skill.LastCastTime.low + casttime*1000 * bot.GetTimeFrequency;
Anyways, I think that the combination of these calculations on 64-bit integers (tables, that is) may result in attempting to use the skill too quickly under certain circumstances. Perhaps the 64-bit 'now' just rolls over, leaving a negative value for the difference between times, leading to attempting to read the memory immediately after writing? Perhaps adding the skill cast time into the 'low' part is overflowing, and when we insert it back we are not compensating by adding the overflow into the 'high' part. Something along those lines.
MM1 does have an __add metamethod on the int64 tables. This means we should be able to have them used as 'normal' numbers like so:
Code: Select all
skill.LastCastTime = skill.LastCastTime + (casttime*1000 * bot.GetTimeFrequency);
- player.lua:887
- player.lua:917
Re: CPU freq.
I do not quite understand it other than trying to read those articles i posted. I just noticed the problem when some people said it worked ok and they had older pcs it runs ok on my single core pc but as I went to quad then eight core cpus the problem got worse. Altering those numbers and it runs better but still is not perfect. When there is lag during peak net traffic it can still crash latency seems to affect it.
I'm not very up on programming these new cpus as I leaned on the early ones and timing was simple then. I just was trying to point you in some direction that might help or at least help others with same problem. After changing the number on my test machines they both can run for quite a while. Now it just crashes is at portals or re-logging. There may be some timing problem in those areas of code.
I'm not very up on programming these new cpus as I leaned on the early ones and timing was simple then. I just was trying to point you in some direction that might help or at least help others with same problem. After changing the number on my test machines they both can run for quite a while. Now it just crashes is at portals or re-logging. There may be some timing problem in those areas of code.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
Did you make the proposed change that I had posted at those two lines or not? I'm not sure what to make of your response.
Re: CPU freq.
oh ill give that a go. i missed what said It seemed like you were explaining what might be happening as it was very like what was said in this person page http://tdistler.com/2010/06/27/high-per ... ux-windows talked about ways to fix the timing problems in games. I got lost reading about half way down.
Reading it a second time I now notice the line numbers.
I edited my test machine it is the one that crashes the worst. Restored the original 1000 back in bot.lua also. I will give that a try.
Reading it a second time I now notice the line numbers.
I edited my test machine it is the one that crashes the worst. Restored the original 1000 back in bot.lua also. I will give that a try.

Last edited by beanybabe on Mon Aug 31, 2015 3:12 am, edited 1 time in total.
Re: CPU freq.
something went wrong my main wp i'm testing works with it but it does not attack anything.
error happen when I attack a mob.
15-08-31 04:25:30 - C:/micromacro/scripts/rom/classes/player.lua:919: attempt
to perform arithmetic on global 'casttime' (a nil value)
error happen when I attack a mob.
15-08-31 04:25:30 - C:/micromacro/scripts/rom/classes/player.lua:919: attempt
to perform arithmetic on global 'casttime' (a nil value)
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
player.lua:917 should be changed from:
to:
Code: Select all
skill.LastCastTime.low = skill.LastCastTime.low +remaining*1000 * bot.GetTimeFrequency
Code: Select all
skill.LastCastTime = skill.LastCastTime + (remaining*1000 * bot.GetTimeFrequency)
Re: CPU freq.
That seems to work now it is attacking again.
The problems I keep having with timing are not related to attacking. I need to find were error is posted. I searches and found this memoryReadByte if you search the forum you can see the errors. This is one of the effects of the timing problem.
The problems I keep having with timing are not related to attacking. I need to find were error is posted. I searches and found this memoryReadByte if you search the forum you can see the errors. This is one of the effects of the timing problem.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
That wasn't to fix the attacking. That was to fix the timer from overflowing and becoming corrupted in attempt to fix the issue you originally had reported. Has it helped or do you still get the error?
Re: CPU freq.
It is running better this may have fixed it. It is handling portals and npc well. I will try it during time of day it fails most and see how it does.
Just as I wrote it was working rom crashed as it finished a daily and was heading to portal. no error message from bot just the critical error from rom.
This does not seem related to the bot.
I read through the code in player.lua and ill say
to you that is over my head.
Just as I wrote it was working rom crashed as it finished a daily and was heading to portal. no error message from bot just the critical error from rom.
This does not seem related to the bot.
I read through the code in player.lua and ill say


Re: CPU freq.
I got this error this afternoon and rom has been crashing. I changed the timing back to the way I had it in bot.lua instead of the /1000 to see if that stops the crashing but left your change in player.lua also.
memorytable 213 attempt to concatenate a nil value
memorytable 213 attempt to concatenate a nil value
Code: Select all
-- Get name/plural address
local nameaddress = memoryReadInt(proc, itemAddress + addresses.nameOffset + pluralOffset)
if nameaddress == 0 and commandMacro ~= 0 and SlashCommand then
SlashCommand("/script GetCraftRequestItem(".. itemId ..",-1)")
local starttime = getTime()
repeat
yrest(5)
nameaddress = memoryReadInt(proc, itemAddress + addresses.nameOffset + pluralOffset)
until nameaddress ~= 0 or deltaTime(getTime(),starttime) > 200
end
--------------------- i added this to see what is nil
if (name or proc or nameaddress) == "nil" then
print ("memorytable name =",name,"proc =",proc,"nameaddress =",nameaddress)
end
---------------------------
213 return name .. memoryReadString(proc, nameaddress)
end
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: CPU freq.
That's an unrelated error to the CPU frequency issue you were having. Anyways, try changing this line:
memorytable.lua:213
to:
memorytable.lua:213
Code: Select all
return name .. memoryReadString(proc, nameaddress)
Code: Select all
return name .. memoryReadRepeat("string", proc, nameaddress)
Re: CPU freq.
i set cpu back to 1000 and added that line to memorytable the first char i run i get this again
undefined player.Class1 in settings.lua debug print i added said the player class was at -1
player class was = 8 before entering drill ground something is changing it to -1 some times
if I change the cpu setting so it not 1000 then I don't seem to get this error.
on starting next char half dozen addresses showed up as undefined so I will run Fixaddress and trying it again. is there some way to know when address change? rom seems to update them in the background.
undefined player.Class1 in settings.lua debug print i added said the player class was at -1
player class was = 8 before entering drill ground something is changing it to -1 some times
if I change the cpu setting so it not 1000 then I don't seem to get this error.
on starting next char half dozen addresses showed up as undefined so I will run Fixaddress and trying it again. is there some way to know when address change? rom seems to update them in the background.
Re: CPU freq.
This error happened twice I changed the divider for cpu speed back to my numbers now it seems to work Ill run it a little more see if that error come back.
Use MACRO: Executing RoMScript "StaticPopup_OnClick(StaticPopup1, 1);".
The game client did not crash.
2015-09-02 16:51:36 - IGF:\StaticPopup_OnClick(StaticPopup1, 1);\:IGF [string "?"]:1581: attempt to index field '?' (a nil value)
Use MACRO: Executing RoMScript "StaticPopup_OnClick(StaticPopup1, 1);".
The game client did not crash.
2015-09-02 16:51:36 - IGF:\StaticPopup_OnClick(StaticPopup1, 1);\:IGF [string "?"]:1581: attempt to index field '?' (a nil value)
Re: CPU freq.
This error happened twice
Use MACRO: Executing RoMScript "StaticPopup_OnClick(StaticPopup1, 1);".
The game client did not crash.
2015-09-02 16:51:36 - IGF:\StaticPopup_OnClick(StaticPopup1, 1);\:IGF [string "?"]:1581: attempt to index field '?' (a nil value)
I changed the divider for cpu speed back to my numbers now it seems to work Ill run it a little more see if that error come back. I think they needs to be some kind of adjustment for this number based on the cpu.
Use MACRO: Executing RoMScript "StaticPopup_OnClick(StaticPopup1, 1);".
The game client did not crash.
2015-09-02 16:51:36 - IGF:\StaticPopup_OnClick(StaticPopup1, 1);\:IGF [string "?"]:1581: attempt to index field '?' (a nil value)
I changed the divider for cpu speed back to my numbers now it seems to work Ill run it a little more see if that error come back. I think they needs to be some kind of adjustment for this number based on the cpu.
Re: CPU freq.
could one of the patches be affecting the other? with both in it is pretty not usable if rom does not crash it gets stuck at portal.
When I change the freq divide to my number I get part of the same error. The char stops in the same place on the portal trying to exit guild castle. note: the nil value part of the error did not occur with the cpu number different. with 1000 at the freq it crashes the bot, with my number it will continue on after I assist char to leave castle.
Use MACRO: Executing RoMScript "StaticPopup_OnClick(StaticPopup1, 1);".
When I change the freq divide to my number I get part of the same error. The char stops in the same place on the portal trying to exit guild castle. note: the nil value part of the error did not occur with the cpu number different. with 1000 at the freq it crashes the bot, with my number it will continue on after I assist char to leave castle.
Use MACRO: Executing RoMScript "StaticPopup_OnClick(StaticPopup1, 1);".
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests