Page 2 of 16
Re: Party Bot (questions/answers)
Posted: Fri Dec 14, 2012 6:59 am
by rock5
Sounds good. Although the more you have one character control everything the slower it will get. It will be continuously doing romscripts after all. Maybe I'll have another crack at trying to find the chat messages in memory. Not much hope of it though.
Re: Party Bot (questions/answers)
Posted: Fri Dec 14, 2012 10:37 am
by dx876234
Nice one Lisa, Ill give it a try
-dx
Re: Party Bot (questions/answers)
Posted: Fri Dec 14, 2012 6:11 pm
by lisa
I am thinking that the "" isn't the best way to go for the code, since half the time you do actually want to have "" in your code.
It can basically check for any characters, any ideas on characters to use that arn't normally used in code.
Code: Select all
code?print("I like to party")?
code!print("I like to party")!
code^print("I like to party")^
code@print("I like to party")@
code$print("I like to party")$
code$_msg = "I am a bot" RoMScript("SendChatMessage('".._msg.."', GUILD)")$
Keep in mind that any extra of the specific character would mess up it's usage.
Personally I am leaning towards ^ or $
Re: Party Bot (questions/answers)
Posted: Sat Dec 15, 2012 4:02 am
by rock5
I would think you could do a pattern search that includes the outer indicators. It should even be possible to do something like
Let me test it
Code: Select all
Command> str = "code(print('I am a bot'))" comm = string.match(str,"code%((.*)%)") print(comm)
print('I am a bot')
So you should be able to use anything that you think is most user intuitive. That is unless you want to be able to do multiple commands on one line.
Re: Party Bot (questions/answers)
Posted: Sat Dec 15, 2012 4:31 am
by lisa
rock5 wrote:"code(print('I am a bot'))"
weird I would expect it to recognize the first ) but it is only doing it for the last ), that makes no sence to me.
from that I would expect it to print
print('I am a bot'
but it doesn't, it prints as you say.
It also means that people can use "" in their code.
Code: Select all
Command> str = 'code"print("I am a bot")"' comm = string.match(str,"code\"(.*)\"") print(comm)
print("I am a bot")
Re: Party Bot (questions/answers)
Posted: Sat Dec 15, 2012 5:39 am
by rock5
Tha6t's because '*' matches the bigbest possible match.
- a single character class followed by '*', which matches 0 or more repetitions of characters in the class. These repetition items will always match the longest possible sequence;
http://www.lua.org/manual/5.1/manual.html#5.4.1
Re: Party Bot (questions/answers)
Posted: Mon Dec 17, 2012 8:39 am
by Jandrana
I played around with party bot during the last days and finally got it working. I was trying to run HoS and it worked out pretty well, but now I'm looking for a way to switch between two "skill sets": one for killing trash (aoe based) and one for killing bosses (skill rotation to get max dps on a single target).
I did not test the new dynamic function calls from lisa, but this could be used to call a function doing the switch between the two skill sets.
Now a question regarding skill rotation: I know that there is "priority based" and a "order based" skill selection. But for a boss fight, you usually start with skills increasing you damage like: elemental catalysis, ... and then start your rotation: plasma arrow, flame, flame, flame, plasma arrow ....
How would you do something like this?
Disable all skills except the ones needed for the dps skill rotation and doing the "buffing skills" via "RomScript('CastSpellByName()')"?
But this usually will only alternate between "plasma arrow" and "flame". If possibly it should cast flame until the buff given by plasma arrow wears off.
Any suggestions?
Re: Party Bot (questions/answers)
Posted: Mon Dec 17, 2012 10:41 am
by rock5
An easy way to switch profile settings, especially if there are a few of them, might be to actually have 2 profiles, 1 for the trash and one for the bosses. Before tackling the boss you would do
and when you finish with the boss
Jandrana wrote:If possibly it should cast flame until the buff given by plasma arrow wears off.
You can add the charged state as a no requirement in your profile. Just add the following to your plasma arrow skill
nobuffname="Charged" nobufftarget="player"
Re: Party Bot (questions/answers)
Posted: Mon Dec 17, 2012 6:17 pm
by lisa
rock5 wrote:An easy way to switch profile settings, especially if there are a few of them, might be to actually have 2 profiles,
That is 1 way to do it, I just did up a function to handle the buffing and changing autouse on the chars.
Code: Select all
function bossbuff(_arg)
if _arg then
if player.Class1 == CLASS_SCOUT then
SlashCommand("/script CastSpellByName(\""..GetIdName(490464).."\");"); -- target area
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490460).."\");"); -- concentration
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490494).."\");"); -- arrow of essence
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490434).."\");"); -- Blood Arrow
elseif player.Class1 == CLASS_PRIEST then
changeProfileSkill("PRIEST_HEALING_SALVE" , "AutoUse", true)
changeProfileSkill("PRIEST_WAVE_ARMOR" , "AutoUse", true)
elseif player.Class1 == CLASS_ROGUE then
SlashCommand("/script CastSpellByName(\""..GetIdName(490506).."\");"); -- Assasins rage
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490507).."\");"); -- premeditation
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(491528).."\");"); -- energy thief
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490333).."\");"); -- ferverant attack
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490350).."\");"); -- informer
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(490355).."\");"); -- evasion
elseif player.Class1 == CLASS_MAGE then
changeProfileOption("COMBAT_DISTANCE" , 200)
changeProfileSkill("MAGE_PURGATORY_FIRE" , "AutoUse", false)
changeProfileSkill("MAGE_FLAME" , "AutoUse", true)
changeProfileSkill("MAGE_FIREBALL" , "AutoUse", true)
end
if player.Class1 == CLASS_WARDEN or player.Class2 == CLASS_WARDEN then
SlashCommand("/script CastSpellByName(\""..GetIdName(493402).."\");"); -- elven amulet
yrest(1100)
SlashCommand("/script CastSpellByName(\""..GetIdName(493406).."\");"); -- savage power
end
SlashCommand("/script CastSpellByName(\""..GetIdName(495174).."\");"); -- fire training
sendPartyChat("done buffing")
else
changeProfileSkill("PRIEST_HEALING_SALVE" , "AutoUse", false)
changeProfileSkill("PRIEST_WAVE_ARMOR" , "AutoUse", false)
changeProfileOption("COMBAT_DISTANCE" , 50)
changeProfileSkill("MAGE_PURGATORY_FIRE" , "AutoUse", true)
changeProfileSkill("MAGE_FLAME" , "AutoUse", false)
changeProfileSkill("MAGE_FIREBALL" , "AutoUse", false)
end
end
bossbuff(true) before attacking boss
bossbuff() after killing boss
Obviously that isn't perfect, wrote it up as I was doing some DoD runs on the fly, it did work well though.
Actually I guess you could do this
profile names like this for boss
charizardboss
sizzlerboss
sarahboss
then after boss switch it back
Re: Party Bot (questions/answers)
Posted: Thu Dec 20, 2012 4:45 am
by Jandrana
I did not know the options mentioned above (nobuffname="Charged" nobufftarget="player").
Thanks, rock and lisa for your suggestions. Will try it during the next days.
Re: Party Bot (questions/answers)
Posted: Sat Dec 22, 2012 6:48 am
by xrozhija
Got an issue with my healer not wanting to heal, unless i manually target the partymember after each battle, as target is cleared on leavecombat.
Ran the following commands
Code: Select all
Command> PartyTable() table.print(partymemberpawn)
table: 02B3E2D0
1: table: 02B2FD68
free_debug1: 0
MaxMP: 27594
MaxHP: 58459
PotionLastOnceUseTime: 0
Mana: 27594
ActualSpeed: 0
Lootable: false
Race: 0
ExpInsertPos: 0
ExpTable: table: 02B2FDB8
MaxEnergy: 0
Attackable: false
Sleeping_time: 0
Class3: -1
Rage: 0
Type: 1
MaxMP2: 1
Id: 1001
Harvesting: false
Level3: 1
Casting: false
PetPtr: 0
Stance: 0
MP: 27594
LastExp: 0
Last_ignore_target_time: 0
ExpUpdateInterval: 10
Fighting: false
Concentration: 0
InventoryDoUpdate: false
ExpPerMin: 0
MaxMana: 27594
Moving: false
Speed: 55
Class1: 5
BotStartTime_nr: 0
TargetIcon: true
InParty: true
Swimming: false
MaxConcentration: 0
SkillQueue: table: 02B2FE08
Name: CENSOR
LastSkillType: 0
LastSkillStartTime: 0
Buffs: table: 02B2FE30
HP: 58459
Z: -16932.802734375
Mounted: false
free_flag3: false
Guild: <UNKNOWN>
PotionLastManaEmptyTime: 0
free_flag2: false
free_flag1: false
Success_waypoints: 0
PotionHpUsed: 0
Death_counter: 0
PotionManaOnceUsed: 0
Alive: true
mobs: table: 02B2FDE0
Unstick_counter: 0
PotionLastUseTime: 0
ranged_pull: false
GUID: 2287
LastTargetPtr: 0
Returning: false
ExpTableMaxSize: 10
PhiriusManaUsed: 0
Last_ignore_target_ptr: 0
Current_waypoint_type: 3
TimeTillLevel: 0
free_counter1: 0
Fights: 0
Sleeping: false
level_detect_levelup: 0
LastExpUpdateTime: 1356176311
PotionLastManaOnceEmptyTime: 0
DirectionY: 0
Direction: 1.6231558964156
free_counter3: 0
PhiriusLastManaEmptyTime: 0
BotStartTime: 1356176311
PhiriusLastHpEmptyTime: 0
InventoryLastUpdate: 1356176311
Nature: 0
PotionManaUsed: 0
Level2: 56
PhiriusHpUsed: 0
MP2: 1
PhiriusLastUseTime: 0
IgnoreTarget: 0
TargetPtr: 0
lastHitTime: 0
Level: 75
LastDistImprove: 1356176311
Cast_to_target: 0
PotionLastHpEmptyTime: 0
PotionHpOnceUsed: 0
MaxRage: 0
free_counter2: 0
Energy: 0
Y: 790.11090087891
X: -8074.9892578125
Class2: 6
Address: 1410851072
PotionLastHpOnceEmptyTime: 0
Battling: false
LastSkillCastTime: 0
Aggressive: false
Using
It does find the correct name of the partyleader
and
it prints false
Re: Party Bot (questions/answers)
Posted: Sat Dec 22, 2012 7:20 am
by lisa
Glad you did the tests I posted =)
Ok so we can now say that the bot isn't working out that there is another character in party, so it is probably an address issue.
So next question.
What game version and what bot version are you using?
Re: Party Bot (questions/answers)
Posted: Sat Dec 22, 2012 9:04 am
by xrozhija
gameversion 5.0.6.2607.en (currently newest live patch)
RoM Bot Version 3.29, Revision 744
Re: Party Bot (questions/answers)
Posted: Sat Dec 22, 2012 9:31 am
by CanceR
same here, i have a similar issue: bot is not healing, due to loosing target of party leader. if party leader is targeted manually - bot starts to buff and heal for a short time, till looses target of party leader. strange is that from time to time - this bug is cleared (may be after PC restart), but later appears again.
i m using latest game client and latest Rev744 of scripts
Re: Party Bot (questions/answers)
Posted: Sat Dec 22, 2012 5:14 pm
by lisa
I'll test it out later today and see what I can see, seems like an address issue though or it might be the issue of using int instead of uint for the address memory reads.
Re: Party Bot (questions/answers)
Posted: Sat Dec 22, 2012 9:41 pm
by lisa
ok it turned out more complicated than just an incorrect address.
Can you give this a try for me, in functions.lua around line 1360 you will see
Code: Select all
local listAddress = memoryReadRepeat("intptr", getProc(), addresses.partyMemberList_address, {addresses.partyMemberList_offset1,addresses.partyMemberList_offset2} )
local memberAddress = listAddress + (_number - 1) * 0x60
replace it with
Code: Select all
local listAddress = memoryReadRepeat("uint", getProc(), 0xA02D10 ) + 0x134
local memberAddress = listAddress + (_number - 1) * 0x60
then test it again with the prints on first post of this topic.
Re: Party Bot (questions/answers)
Posted: Sun Dec 23, 2012 5:21 am
by xrozhija
With the edited lines in functions.lua i get the following
Code: Select all
Command> print(checkparty())
Party member 1 has the name of CENSOR
true
and
Code: Select all
PartyTable() table.print(partymemberpawn)
finds 2 party members data
so it seems it works with the change.
Will set them out on a waypoint and test it a bit further, and hope it will start healing when needed.
EDIT: Have been running a waypoint for 30 mins now, and it works perfectly with the change in functions.lua line 1359+1360
Re: Party Bot (questions/answers)
Posted: Sun Dec 23, 2012 6:43 am
by lisa
That code will work until game has another patch, I will see where rock is with anything he is working on before commiting anything.
I want to move all of the party functions into party.lua so that if anything needs updating/fixing I can do it without affecting anything else in the bot.
Re: Party Bot (questions/answers)
Posted: Sun Dec 23, 2012 8:48 am
by rock5
Looks like, even though the address found for partyMemberList is correct, 1 of the offsets have changed. So it looks like. So it looks like this new method is not good enough either. I'll see if I can find a better way.
BTW the offset that changed is partyMemberList_offset1. It should be 0x288 now.
Re: Party Bot (questions/answers)
Posted: Sun Dec 23, 2012 9:04 am
by rock5
Awe, rom4u is updating so I wont have a slightly older client to test with. Does anyone know of a server that uses clients that are always slightly behind?