Page 5 of 6
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Mon Nov 12, 2012 3:16 pm
by mrphil
Erm, may I know what to replace the 'Char1', 'Char2', 'Char3', and 'Char4'? What does it mean by 'player.Name' and 'joinname' ? I'm sorry, I'm new to this.
Code: Select all
if DOD_SOLO then
if player.Name == "Char1" then
joinname = "Char2"
elseif player.Name == "Char3" then
joinname = "Char4"
else
error("No party match!",0)
Every time I tried to put my char name and my another char name, I got this error,
Code: Select all
scripts\rom\bot.lua:505: onLoad error: No party match!
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Mon Nov 12, 2012 6:52 pm
by kuripot
mrphil wrote:Erm, may I know what to replace the 'Char1', 'Char2', 'Char3', and 'Char4'? What does it mean by 'player.Name' and 'joinname' ? I'm sorry, I'm new to this.
Code: Select all
if DOD_SOLO then
if player.Name == "Char1" then
joinname = "Char2"
elseif player.Name == "Char3" then
joinname = "Char4"
else
error("No party match!",0)
Every time I tried to put my char name and my another char name, I got this error,
Code: Select all
scripts\rom\bot.lua:505: onLoad error: No party match!
only this for the follower
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad><
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Sun Nov 25, 2012 7:07 am
by lisa
AlterEgo95 wrote:Is there a way to target the party leader? Or the member which has got aggro?
For healer or DPS?
if DPS easy as, just get it to do a target of target check.
If healer then you are probably better off just checking party for the specific buff/debuff as opposed to checking what the hostile mob is targeting.
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Sun Nov 25, 2012 4:15 pm
by Ego95
lisa wrote:AlterEgo95 wrote:Is there a way to target the party leader? Or the member which has got aggro?
For healer or DPS?
if DPS easy as, just get it to do a target of target check.
If healer then you are probably better off just checking party for the specific buff/debuff as opposed to checking what the hostile mob is targeting.
For my little healer. My little dwarf should heal the party and if my main char gets a specific debuff he should use a "cleanse" on him.
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Sun Nov 25, 2012 6:50 pm
by lisa
I don't recall there being any code in the bot to deal with cleansing so you will probably need to add in some code for it.
Probably something in the onpreskillcast, if you know the id or name of the curse then it should be easy enough, you could probably just make up a specific function for the instance as party healer and do a check in the loop for the curse/debuff and cleanse it as needed.
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Mon Nov 26, 2012 8:31 pm
by Cindy
How do you make one of followers act as party healer? (ie they are running the DOD_(Full_)Follower script)
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Wed Nov 28, 2012 5:46 am
by kuripot
i try this.. self heal in my alt..
Code: Select all
<waypoint x="2204" z="2510" y="401" tag="okander">
__WPL:setForcedWaypointType("NORMAL")
changeProfileOption("LOOT_PAUSE_AFTER", 2)
changeProfileOption("LOOT_ALL",true)
changeProfileOption("LOOT",true)
if CountObjectsNearPoint("Okander") > 0 then
if not player.Battling then
yrest(250)
end
__WPL:setWaypointIndex(__WPL:findWaypointTag("okander"))
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("out"))
repeat
yrest(500*math.random(4))
local okander = player:findNearestNameOrId("Okander")
if not okander then break end
keyboardPress( key.VK_F1 );
yrest(500)
keyboardPress( key.VK_0 );
player:target(okander)
player:update()
player:loot()
until inventory:itemTotalCount("Ancient Memento") > mentos
end
</waypoint>
which urgent heal place in action bar 0
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Thu Nov 29, 2012 5:43 am
by Ego95
lisa wrote:I don't recall there being any code in the bot to deal with cleansing so you will probably need to add in some code for it.
Probably something in the onpreskillcast, if you know the id or name of the curse then it should be easy enough, you could probably just make up a specific function for the instance as party healer and do a check in the loop for the curse/debuff and cleanse it as needed.
This is what I tried a few weeks ago
Code: Select all
function MainCharFear()
if player.name = "Myhealer" then -- only use this code with my healer
if player:findNearestNameOrId(103170); -- second boss in dod
local target = RoMScript(TargetUnit("party1"))
target:updateBuffs()
if target:hasDebuff("Gedankenkontrolle") then
player:cast("PRIEST_CLEANSE")
end
end
end
end
and to start the function I used
Code: Select all
function settings.profile.events.onSkillCast()
MainCharFear()
end
But the first error seems to be in the
.
What's wrong here? And would the other stuff work?
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Thu Nov 29, 2012 5:52 am
by lisa
AlterEgo95 wrote:if player.name = "Myhealer" then
should be Name
As always things need to be exact or they won't work.
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Thu Nov 29, 2012 8:35 am
by rock5
AlterEgo95 wrote:if player.name = "Myhealer" then
And of course it needs to be a double equals "==". 1 equal means 'assign a value'. 2 equals means 'is equal to'.
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Thu Jan 10, 2013 11:22 am
by Ego95
Hi
I was not able to bot dod for some time so now I started again. The code I tried should work normally, but it doesn't. Everything seems so be ok but now he gets a problem with targeting my main char:
Code: Select all
5:14pm - ...ns Rom Bot/micromacro/scripts/rc3/classes/player.lua:965: onSkillCas
t error: [string "..."]:106: attempt to call global 'TargetUnit' (a nil value)
Code: Select all
function settings.profile.events.onSkillCast()
if player.Name == "MyHealer" then
if player:findNearestNameOrId(103170) then
local target = RoMScript(TargetUnit("party1"))
target:updateBuffs()
if target:hasDebuff("Gedankenkontrolle") then
player:cast("PRIEST_CLEANSE")
end
end
end
end
/script TargetUnit("party1") in the ingame chat works fine
The other solution I thought about was
Code: Select all
local target = player:findNearestNameOrId("MainCharName")
player:target(target.Address)
target:updateBuffs()
but it seems like my healer doesn't target my main and then gets
Code: Select all
attempt to call method 'updateBuffs' (a nil value)
because he doesn't has a target.
Anything else I can do?
P.S.: While compared this code with other RoMScript codes I saw, that there have to be two brackets
With my function posted above the healer will do the run until he reaches the second boss and then gets the error message, but if I use the version with the extra brackets it errors when loading the waypoint.
AlterEgo95
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Thu Jan 10, 2013 2:33 pm
by rock5
AlterEgo95 wrote: attempt to call global 'TargetUnit' (a nil value)
The RoMScript should be
Code: Select all
local target = RoMScript("TargetUnit(\"party1\")")
That's the way I like to deal with double sets of quotes. Another, and probably easier, way is
Code: Select all
local target = RoMScript('TargetUnit("party1")')
AlterEgo95 wrote:attempt to call method 'updateBuffs' (a nil value)
findNearestNameOrId returns a object not a pawn. So you would have to change it to a pawn first before checking it's buffs. eg.
Code: Select all
local target = player:findNearestNameOrId("MainCharName")
if target then
target = CPawn(target.Address)
player:target(target.Address)
target:updateBuffs()
-- etc.
end
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Fri Jan 11, 2013 9:24 am
by Ego95
Thanks.
Code: Select all
local target = RoMScript("TargetUnit(\"party1\")")
the ordner of the \ and the " looked a bit strange. But with this code he runs to the second boss and error with
Code: Select all
attempt to index local 'target' (a nil value)
After that I tried the same with an other order because I was not sure if you made a spell mistake:
Code: Select all
RoMScript("TargetUnit(\"party1"\)")
and
Code: Select all
RoMScript("TargetUnit("\party1\")")
Those two get the normal onLoad error.
Also tried
Code: Select all
local target = RoMScript('TargetUnit("party1")')
but this errors with the error message postet at top.
I don't have any further ideas how to get this working

Anyway thanks.
AlterEgo95
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Fri Jan 11, 2013 9:49 am
by rock5
What '\' does is escape a special character. If you just do double quotes it get interpreted as
local target = RoMScript("TargetUnit(" party1 ")")
where the bold bits are seen as a string and party1 is seen as a variable. This is a syntax error. To send just 1 big string, you have to escape the inner quotes. You do this by putting a \ before it.
local target = RoMScript("TargetUnit(\"party1\")")
What this means is the inner quotes have their special meaning removed and are just sent as a string character ". So this is what is received in the game
AlterEgo95 wrote:attempt to index local 'target' (a nil value)
What this means is you tried to treat 'target' as a table by indexing it, eg. target.somevariable, but it was in fact nil. It would be nil if a target wasn't found. That is why I added that check to see in target exists first before continuing with targeting. eg.
Code: Select all
local target = RoMScript("TargetUnit(\"party1\")")
if target then
etc.
Re: DoD First Boss spam solo and party, full DoD now too
Posted: Fri Jan 11, 2013 10:15 am
by Ego95
Lol thanks, this works so far I think
Code: Select all
function settings.profile.events.onSkillCast()
if player.Name == "MyHealer" then
if player:findNearestNameOrId(103170) then
local target = RoMScript("TargetUnit(\"party1\")")
if target then
target:updateBuffs()
if target:hasDebuff("Gedankenkontrolle") then
player:cast("PRIEST_CLEANSE")
end
end
end
end
end
I'm going to test it a few runs this evening
AlterEgo95