668 Changelog

For changelogs and discussion related to a specific revision.
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

668 Changelog

#1 Post by rock5 » Fri Oct 28, 2011 11:28 pm

Mostly just a collection of small changes that have been accumilating in my rom folder. A bit overdue but I kept putting it off until the issues we had with patch 4.03 were resolved and things settled down.
  • Added get 'getHotkeyByName' function to fix problems with users who mess up their key bindings list. This should never happen but 1 user, who copied some files from 1 game installation to another, messed it up and their key bindings list was missing the new 'Partner Bag' binding. So 'Toggle title/guild' wasn't their 49th binding but their 48th. This function solves that and any related future problem by getting the hotkey 'by name'. Note: this is mostly invisible to users.
  • Added 4th argument "range" to player:moveTo() function which effectively makes player:moveInRange obsolete. Also dynamically calculates where to move to when moving into range of a target even if it's moving. Hm.. I should have changed 'moveInRange' to use this.
  • Removed confusing autosell debug message about durability. When using autosell with debugging on, a debug message about durability would be shown for each item even though there was nothing wrong with durability. This caused users to think there was a problem with durability when there was not. So I removed it. A message will still be shown if not sold because of durability.
  • Added autosell debug messages for stats number and item types. When using debug with autosell no messages were shown if items were not sold because of wrong stat number or wrong type. Now they do.
  • Added 'MaxDurability' to inventory items. I noticed that equiped items had max durability but not inventory items, so I added it.
  • Changed item 'BoundStatus' to a byte value. I noticed that the rest of the integer was used for something else so sometimes BoundStatus returned a large value instead of a value from 0 to 3. So changed it to read byte only.
  • Fixed bug that caused bot to remember item stats even though the slot is empty. When an item was removed from a slot, the 'Stats' value was not reset. Now it is.
  • Increased buff limit to 50. Some people can apply more than 20 buffs. When this happened it returned no buffs. This increased limit should fix that.
  • Added better RU support (thx Bot_romka) Some changes by bot_Romka to add Russian language support.
  • Modified object searches so that if you use quotes around and id, it still works. For example, this will work where before it didn't

    Code: Select all

    player:findNearestNameOrId("123456")
  • Added or fixed the following skills in the database; MAGE_STARS_OF_LIGHT, SCOUT_TARGET_LOCK, SCOUT_ARROW_SHIELD, DRUID_SAVAGE_BLESSING, WARDEN_EARTH_SPIRIT_ESSENCE, WARDEN_UNTAMABLE.
  • Fixed issues with COMBAT_DISTANCE, COMBAT_TYPE and COMBAT_RANGED_PULL when changing class (hopefully). Seems to be working correctly now but it's hard to test all scenarios.
  • Added batch files, StartCommandLine.bat, Get_Player_Position.bat and Get_Object_Id.bat. Just a quick way to start those files. Not really neccessary but doesn't hurt to have them.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 668 Changelog

#2 Post by lisa » Sat Oct 29, 2011 12:09 am

something got broken in 668 =(

partyhealer 667 works perfectly, 668 it doesn't buff or heal.
I'll see if I can narrow it down but since you did the code for 668 you would probably have a better idea of where to start looking.

It has all the pawn info, prints the player names, so partymember table works. I'll do some testing but just thought I'd let you know.

it all works except for when it does

Code: Select all

player:checkSkills(true);
It doesn't even try to use any skills, turned on skill debug and no prints at all.
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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 668 Changelog

#3 Post by lisa » Sat Oct 29, 2011 1:30 am

Ok I found what makes it stop using skills.

Ok I am using a P/M/S
If you remove the warrior skills section from profile it stops using skills.
have

Code: Select all

	<skills_warrior>

	</skills_warrior>
in profile and it works fine.

I have no idea why removing skills_warrior would make priest skills stop working.
*shrugs*

There is obviously something in the 668 code which is affecting this as I update to 667 and the same profile works fine with or without skills_warrior.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#4 Post by rock5 » Sat Oct 29, 2011 1:43 am

That gives me a clue. There was something I changed relating to the skills table. I'll have a look.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 668 Changelog

#5 Post by lisa » Sat Oct 29, 2011 2:02 am

Yeah when I printed the skills table it didn't seem to have the actual skill information from memory, just the stuff in database/profile.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#6 Post by rock5 » Sat Oct 29, 2011 3:01 am

Try changing line 2652 of player.lua

Code: Select all

	if self.Class1 ~= oldclass or (#settings.profile.skills == 0 and #settings.profile.skillsData ~= 0) then
to

Code: Select all

	local skillDataCount = 0
	for k,v in pairs(settings.profile.skillsData) do skillDataCount = skillDataCount + 1 end
	if self.Class1 ~= oldclass or (#settings.profile.skills == 0 and skillDataCount ~= 0) then
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 668 Changelog

#7 Post by lisa » Sat Oct 29, 2011 3:15 am

Removed the skills_warrior and it was casting skills as it should.

If you are doing a commit can you remove the cooldown from this

Code: Select all

	<skill name="KNIGHT_HOLY_SEAL" id="491368" mana="30"  type="buff" buffname="501772" target="self" />
For some reason it had cooldown of 300 when there is no cooldown, duration is 300 though.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#8 Post by rock5 » Sat Oct 29, 2011 3:48 am

In the olden days when buffs weren't checked, sometimes 'duration' and 'cooldown' were used interchangably. And it worked ok. When I added the buff checks I cleared out all the durations but this was left because it was written as a cooldown.

Well that's what I think happened anyway.

I'll add it to my next commit.
  • 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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#9 Post by rock5 » Sat Oct 29, 2011 5:47 am

Ok commited to rev 669, but did it a different way.

So, there's no easy way to count the items in a table but turns out there's an easy way to tell if a table is empty. "next(table)" returns nil if empty. That's what I used. I'm so happy I found that. I'm going to remember that for future use.
  • 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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 668 Changelog

#10 Post by Administrator » Sat Oct 29, 2011 4:13 pm

rock5 wrote: So, there's no easy way to count the items in a table
Why doesn't #tablename work?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#11 Post by rock5 » Sat Oct 29, 2011 9:49 pm

Administrator wrote:
rock5 wrote: So, there's no easy way to count the items in a table
Why doesn't #tablename work?
No. That only counts numbered items in table and only those in consecutive order from 1. So if

Code: Select all

tablename = {[4]=stuff,[5]=stuff}
Which is what happened in my case, then

Code: Select all

#tablename 
will give '0'.

That's why it only worked for Lisa if she had the warrior skills section included. Warrior class is 1. Therefore there would have been a [1]= in the table so #tablename returned a value > 0.

'next(tablename)' returns the first value regardless of the types.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 668 Changelog

#12 Post by lisa » Sun Oct 30, 2011 11:42 pm

hmm seems when waitforloadingscreen is in action the keys to stop or pause MM won't work. End or ctrl + L don't do anything.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#13 Post by rock5 » Mon Oct 31, 2011 7:33 am

I've noticed that too but I've found that even if nothing appears in the mm window, it stops anyway or eventually shows the "Paused" text eventually. It probably has to do with the fact that I changed waitforloadingscreen to not yield. Pausing must happen during yield.

Yielding during loading screen was removed because any code or userfunctions that use timer events might try to access inaccessable areas of memory or do a RoMScrpt commands, during the loading screen.

So I'm not sure what can be done. Is there a way to make the bot react to keypresses such as the End key without yielding to other code such as userfunctions?
  • 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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 668 Changelog

#14 Post by Administrator » Mon Oct 31, 2011 1:28 pm

rock5 wrote:So I'm not sure what can be done. Is there a way to make the bot react to keypresses such as the End key without yielding to other code such as userfunctions?
No, I don't think so. But, I figured it should still be running the function to check for those hotkeys every few lines with a debug hook.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 668 Changelog

#15 Post by rock5 » Mon Oct 31, 2011 9:46 pm

I'm not sure what you mean by 'debug hook'. Are you saying it checks for those keypresses occationally even though the waitForLoadingScreen doesn't yield?
  • 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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 668 Changelog

#16 Post by Administrator » Wed Nov 02, 2011 8:36 am

rock5 wrote:I'm not sure what you mean by 'debug hook'. Are you saying it checks for those keypresses occationally even though the waitForLoadingScreen doesn't yield?
It should be. A hook is used so that every 10 lines, it will check for global hotkeys (CTRL+L, start/stop keys) even if you do not yield. This was done to help prevent scripts from going out of control (such as infinite loops).

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 668 Changelog

#17 Post by lisa » Wed Nov 02, 2011 10:35 am

when I do a full account on the same WP and it gets to last char, it logs to character select screen and is waiting for the game to log back in. At that stage no keypresses stop the bot. I can either log in any character and then stop bot or I can close MM and execute it again.
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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 668 Changelog

#18 Post by Administrator » Thu Nov 03, 2011 12:29 am

Is the while loop for that perhaps running inside of a coroutine other than the main one? That is, is it running inside a timed function or something?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests