CPawn error occasionally during load screen.
CPawn error occasionally during load screen.
I have been getting a CPawn error occasionally since last update. It happens for me during character resurection load screen.
My guess is it is trying to update during load screen and gets a nil value.
Doesn't happen all the time so I am guessing that a timer has been adjusted or maybe a waitforloadscreen function has been altered.
My guess is it is trying to update during load screen and gets a nil value.
Doesn't happen all the time so I am guessing that a timer has been adjusted or maybe a waitforloadscreen function has been altered.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: CPawn error occasionally during load screen.
I can't see any changes to resurrect() for ages and it doesn't use waitForLoadingScreen().
It looks like it only ever had the WAIT_TIME_AFTER_RES pause which is 8000ms which doesn't seem much.
If you can confirm that the loading screen appears I could always add a waitForLoadingScreen().
It looks like it only ever had the WAIT_TIME_AFTER_RES pause which is 8000ms which doesn't seem much.
If you can confirm that the loading screen appears I could always add a waitForLoadingScreen().
- 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: CPawn error occasionally during load screen.
It is definately only during loading screen when trying to resurect, killed a character non stop for about an hour testing it. Amazing how easy they die with no hp potions lol
It wasn't everytime though, occasionally the load screen would take longer and that's when the error came up. Would depend on how much I have PC doing at the time, if I load up several RoM clients and a few web browsers then it tends to get a little longer on the load screen.
It wasn't everytime though, occasionally the load screen would take longer and that's when the error came up. Would depend on how much I have PC doing at the time, if I load up several RoM clients and a few web browsers then it tends to get a little longer on the load screen.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: CPawn error occasionally during load screen.
Ok I've added waitForLoadingScreen() after resurrection. That should fix it.
- 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: CPawn error occasionally during load screen.
I got it also, also with waitForLoadingScreen() option...
look
look
Code: Select all
<!-- # 43 --><waypoint x="-20792" z="6228" y="-202"> yrest(1500);
player:target_NPC("Maylee");
yrest(1500);
sendMacro("ChoiceOption(4);");
waitForLoadingScreen(); </waypoint>
<!-- # 44 --><waypoint x="-21967" z="3935" y="-149"> player:merchant("Pierdon");
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: CPawn error occasionally during load screen.
I can confirm this.
Sometimes there is a Cpawn Error when using waitforLoadingScreen.
And as Lisa said it depends on how much your CPU has to do.
Sometimes there is a Cpawn Error when using waitforLoadingScreen.
And as Lisa said it depends on how much your CPU has to do.
Re: CPawn error occasionally during load screen.
The image shows that it was already heading to waypoint 44. That means it had already finished with waypoint 43. Which means the error happened after waitForLoadingScreen() had already finished.j19861986 wrote:I got it also, also with waitForLoadingScreen() option...
lookCode: Select all
<!-- # 43 --><waypoint x="-20792" z="6228" y="-202"> yrest(1500); player:target_NPC("Maylee"); yrest(1500); sendMacro("ChoiceOption(4);"); waitForLoadingScreen(); </waypoint> <!-- # 44 --><waypoint x="-21967" z="3935" y="-149"> player:merchant("Pierdon");
So the problem was not with waitForLoadingScreen().
- 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
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: CPawn error occasionally during load screen.
I think it's trying to move to the next waypoint although the loading screen is still shown.
Re: CPawn error occasionally during load screen.
So you are suggesting waitForLoadingScreen() is failing to wait until the loading screen is completely gone? I can't see how that can happen. It will only exit the function when the loading screen address is equal to '0'. For it to exit early it would have to read '0' when it's actually still '1'. Maybe the game is buggy when the system is stressed and changes the address to '0' before it finishes loading? Seems unlikely though.JackBlonder wrote:I think it's trying to move to the next waypoint although the loading screen is still shown.
Maybe it just needs a pause.
Can you guys maybe try adding a yrest after using the waitForLoadingScreen() function and see if that helps. Just a few seconds should do it.
- 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: CPawn error occasionally during load screen.
On the topic of waitForLoadingScreen()...
I have an SSD so my load times are usually extremely short. The problem is that sometimes there is no loading screen at all and waitForLoadingScreen() will never complete. I have a Cyclops Lair farm script and it happens often when entering the Lair after a few runs. I've had to use yrest instead. How about something like this: waitForLoadingScreen(5) - if after 5 seconds we are still waiting for load screen, assume we have already loaded.
I haven't noticed any crashes related to waitForLoadingScreen().
I have an SSD so my load times are usually extremely short. The problem is that sometimes there is no loading screen at all and waitForLoadingScreen() will never complete. I have a Cyclops Lair farm script and it happens often when entering the Lair after a few runs. I've had to use yrest instead. How about something like this: waitForLoadingScreen(5) - if after 5 seconds we are still waiting for load screen, assume we have already loaded.
I haven't noticed any crashes related to waitForLoadingScreen().
Re: CPawn error occasionally during load screen.
Wow, no loading screen at all? That's mind blowing.Alkaiser wrote:On the topic of waitForLoadingScreen()...
I have an SSD so my load times are usually extremely short. The problem is that sometimes there is no loading screen at all and waitForLoadingScreen() will never complete. I have a Cyclops Lair farm script and it happens often when entering the Lair after a few runs. I've had to use yrest instead. How about something like this: waitForLoadingScreen(5) - if after 5 seconds we are still waiting for load screen, assume we have already loaded.
I haven't noticed any crashes related to waitForLoadingScreen().
Your idea wouldn't really work. The way the function works is, first it waits for the loading screen to appear, then it waits for it to disappear. The time it takes to appear will be different in different situations, eg. when changing character the character will wait 30s before logging off then change character then finally show the loading screen. So 5s wouldn't be long enough. I guess it could do with a general timeout but usually it wouldn't make sense to continue the script it if failed to teleport as you would be in the wrong area for the rest of the script.
I think yours is a special case so if yrest(5) work, just use that.
- 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: CPawn error occasionally during load screen.
I was thinking something along the lines of:
After looking closer (if I'm understanding it right), I see that it is possible for this function to miss the load screen if it appears for less than 1 second. Maybe lowering the yrest value in the first loop would help?
Code: Select all
function waitForLoadingScreen()
-- wait for loading screen to appear - OR WAIT FOR A SPECIFIED TIME
if memoryReadBytePtr(getProc(), addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 0 then
repeat
yrest(1000)
until memoryReadBytePtr(getProc(), addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 1 or time_elapsed > 5 seconds
end
-- wait until loading screen is gone
repeat
yrest(1000)
until memoryReadBytePtr(getProc(),addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 0
player:update()
end
Re: CPawn error occasionally during load screen.
That's correct. Try a smaller value and see if it helps. If it does, I don't have a problem committing it.Alkaiser wrote: After looking closer (if I'm understanding it right), I see that it is possible for this function to miss the load screen if it appears for less than 1 second. Maybe lowering the yrest value in the first loop would help?
- 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: CPawn error occasionally during load screen.
I've set the first loop to yrest(100). So far so good. I'll keep it running all night and see what happens.rock5 wrote:That's correct. Try a smaller value and see if it helps. If it does, I don't have a problem committing it.Alkaiser wrote: After looking closer (if I'm understanding it right), I see that it is possible for this function to miss the load screen if it appears for less than 1 second. Maybe lowering the yrest value in the first loop would help?
EDIT:
It's been running for over 14 hours now and it hasn't gotten stuck even once. I'd say it fixed my problem.
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: CPawn error occasionally during load screen.
I tested the waitForLoadingScreen() with my netbook (low CPU power ) and the "Error reading memory in CPawn:update()" appears while the loading screen is still shown. I even added a yrest(15000) after waitForLoadingScreen() but it didn't help.
I then added a printf("")
which is not reached when the error appears.
So the error has to happen during waitForLoadingScreen.
I think the memory pointer is switched when the blue bar reaches the right side and rombot tries to update player data player data is not readable when the loading screen is still there
[Edit]
After adding yrest(2000) before player:update() in waitForLoadingScreen() the error does not appear any more.
I then added a printf("")
Code: Select all
waitForLoadingScreen();
printf("Wait another 15 seconds\n");
yrest(15000);
So the error has to happen during waitForLoadingScreen.
I think the memory pointer is switched when the blue bar reaches the right side and rombot tries to update player data player data is not readable when the loading screen is still there
[Edit]
After adding yrest(2000) before player:update() in waitForLoadingScreen() the error does not appear any more.
Re: CPawn error occasionally during load screen.
I'll add it to my next commit.JackBlonder wrote:[Edit]
After adding yrest(2000) before player:update() in waitForLoadingScreen() the error does not appear any more.
- 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
Who is online
Users browsing this forum: No registered users and 3 guests