Page 1 of 3
level up the weapon ability
Posted: Mon May 14, 2012 6:59 am
by gloover
Hey rock, hi lisa.
I want to level up the weapon ability by hitting on frog-eggs in tergothen bay and also using simple repair hammer.
Have created a script for a long time for leveling my weapons on "Mendoza Ayekin" so it works fine, but it doesnt in tergothen bay - I cannot get this f... eggs in target. Have u any solutions, whats going wrong there?
Here is my script:
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
changeProfileOption("MAX_TARGET_DIST", 25);
changeProfileOption("COMBAT_DISTANCE", 25);
local timetowait = 43200 --43200 sec. = 12 Hours
local starttime = os.time()
repeat
player:clearTarget();
player:target(player:findNearestNameOrId(106062)) --106062 Tergothen bay frog egg, 104146 Mendoza Ayekin
if player:haveTarget() then
sendMacro("UseSkill(1,1)");
yrest(10000)
if ( 5 > inventory:getMainHandDurability() ) then
cprintf(cli.lightred,"Durability decreased down to: %s\n", inventory:getMainHandDurability());
if inventory:itemTotalCount(201967) > 0 then
cprintf(cli.lightgreen,"Using simple repair hammer....")
inventory:useItem(201967);
RoMScript("PickupEquipmentItem(15)")
cprintf(cli.yellow,"DONE!\n")
inventory:update()
else
cprintf(cli.lightred,"NO REPAIR HAMMER LEFT!\n")
player:clearTarget();
player:sleep()
end
end
end
until os.time() - starttime >= timetowait
cprintf(cli.lightred, "Time out!\n")
RoMScript("QuitGame()");
</onLoad>
</waypoints>
thx in advance
Re: level up the weapon ability
Posted: Mon May 14, 2012 7:44 am
by rock5
Are you talking about the fact that it keeps clearing the target after the egg has taken some damage? That might be because the egg doesn't target you. It may have worked with Mendoza if that mob targeted you.
The problem is "player:haveTarget". That does the regular checks so the ANTI_KS value comes into play. You can set ANTI_KS to false. That should work. Or you could not use haveTarget. Something like.
Code: Select all
local egg = player:findNearestNameOrId(106062)
if egg then
player:target(egg.Address)
Attack() -- You can use "Attack()" instead of "sendMacro("UseSkill(1,1)")"
yrest(10000)
....etc
Re: level up the weapon ability
Posted: Mon May 14, 2012 9:01 am
by gloover
Ah, ok thx rock.
One problem exist by this - if the egg was destroyed, the bot search for another one and running to them.
How can I decrease the range of "FindNearestNameorID"?
decreasing wandar radius, combat and target range also the harvest distance, all of the down to 10, but the bot ist still runing to the next egg
Re: level up the weapon ability
Posted: Mon May 14, 2012 9:19 am
by rock5
findNearestNameOrId on its own doesn't limit it's range but you could check it's range after it searches. So,
Code: Select all
if egg and 50 > distance(egg.X, egg.Z, player.X, player.Z) then
Re: level up the weapon ability
Posted: Mon May 14, 2012 9:37 am
by gloover
great rock, thank u very much!
If you also know how to type the "weapon ability value" in the bot window, I would be very very glad!
Re: level up the weapon ability
Posted: Mon May 14, 2012 9:49 am
by rock5
gloover wrote:If you also know how to type the "weapon ability value" in the bot window, I would be very very glad!
I found this
http://www.theromwiki.com/API:GetPlayer ... SkillValue
So something like
Code: Select all
print("Sword skill is "..RoMScript("GetPlayerCurrentSkillValue(\"BLADE\")"))
Re: level up the weapon ability
Posted: Mon May 14, 2012 10:07 am
by gloover
yea, rock - you are my hero. Thats exactly I was searching for.
Last question: how can I check the type of equiped Item in the main hand? For example: if mainhand equiped item is sword then ...
Sorry, for so stupid questions, but I found nothing about this in repository.
Thanx again!
Re: level up the weapon ability
Posted: Mon May 14, 2012 10:23 am
by rock5
Maybe something like,
Code: Select all
local mainhand = inventory.EquipSlots[16]
local weapon
if mainhand:isType("1-Handed Swords") then
weapon = "BLADE"
elseif mainhand:isType("2-Handed Swords") then
weapon = "CLAYMORE"
etc.
...
print("Weapon skill is "..RoMScript("GetPlayerCurrentSkillValue(\""..weapon.."\")"))
You can get the rest of the weapon type names from "rom\cache\itemtypestable.lua".
Re: level up the weapon ability
Posted: Mon May 14, 2012 11:19 am
by rock5
Hey, I'd double check to see if durability makes any difference to the weapon skill you gain. I've been doing a bit of testing and durability has dropped to about 35 and the weapon skill gained still seems the same.
Re: level up the weapon ability
Posted: Mon May 14, 2012 6:35 pm
by Ego95
Hey, I'd double check to see if durability makes any difference to the weapon skill you gain. I've been doing a bit of testing and durability has dropped to about 35 and the weapon skill gained still seems the same.
Yes, that's right. It doesn't matter, if the durability is 35, 120 or maybe just 1. But after 12 hours (like in the script) the durability will be at 0 and if it's 0 you only level up the Weaponless Skill. It's the same if you hit a mob, when it's at 0, you will make damage like you don't wear a weapon
Re: level up the weapon ability
Posted: Tue May 15, 2012 1:59 am
by gloover
AlterEgo95 wrote:Hey, I'd double check to see if durability makes any difference to the weapon skill you gain. I've been doing a bit of testing and durability has dropped to about 35 and the weapon skill gained still seems the same.
Yes, that's right. It doesn't matter, if the durability is 35, 120 or maybe just 1. But after 12 hours (like in the script) the durability will be at 0 and if it's 0 you only level up the Weaponless Skill. It's the same if you hit a mob, when it's at 0, you will make damage like you don't wear a weapon
Thats right, after the durability of the weapon going down to 0, you will start leveling the weaponless ability - therefore it should use simple repair hammer (also in my script) - it works fine; repair every 2-3 hours, depending on the main durability.
Re: level up the weapon ability
Posted: Fri May 18, 2012 9:41 am
by pman
rock5 wrote:
Code: Select all
local mainhand = inventory.EquipSlots[16]
local weapon
if mainhand:isType("1-Handed Swords") then
weapon = "BLADE"
...
I got an error when using this maybe not existing isType() method... attampt to call a nil value. I tried to find that function, but without luck
Furthermore I have the problem, that Im using the german version, so my cachefile is german, and I think I have to use the english ones.
If I get this done I will upload the file, so that everyone can use it...
have a nice day, pman
Re: level up the weapon ability
Posted: Fri May 18, 2012 10:10 am
by rock5
The item type names are language specific. If you want to use them in german you will have to translate them.
Re: level up the weapon ability
Posted: Sat May 19, 2012 2:50 am
by Hidden
There is an easier way.
In Ravenfell the Deadland Sand Scorpion Pupa regen so they cant be killed just attack them no scripting required your character will hit them 24/7.
Although you should probably add something to repair the weapon when dura is lowered.
**EDIT**
If your hitting them to hard go to logar buy the crappiest weapon you can get naked and hit them.
Re: level up the weapon ability
Posted: Sat May 19, 2012 8:11 am
by pman
Hidden wrote:There is an easier way.
In Ravenfell the Deadland Sand Scorpion Pupa regen so they cant be killed just attack them no scripting required your character will hit them 24/7.
Although you should probably add something to repair the weapon when dura is lowered.
**EDIT**
If your hitting them to hard go to logar buy the crappiest weapon you can get naked and hit them.
lol, so you have no clue whats going on here
Re: level up the weapon ability
Posted: Sat May 19, 2012 1:32 pm
by Hidden
pman wrote:Hidden wrote:There is an easier way.
In Ravenfell the Deadland Sand Scorpion Pupa regen so they cant be killed just attack them no scripting required your character will hit them 24/7.
Although you should probably add something to repair the weapon when dura is lowered.
**EDIT**
If your hitting them to hard go to logar buy the crappiest weapon you can get naked and hit them.
lol, so you have no clue whats going on here
Your raising the weapon ability for your class. That's whats going on unless i missed something?
ALL my characters weapon abilities are maxed from using this method. The target regenerates health so hitting it with lvl 8 weapons and no gear you hit it for less than it regens.
You can hit the same target all day long 24/7 as long as you repair the weapon every hour or so.
Weapon lvl, dura (unless its 0) and target have nothing to do with raising the weapon skill of your character.
Re: level up the weapon ability
Posted: Sun May 20, 2012 8:15 am
by pman
yeah of course, but its about lvling the weapon in tergothen bay, there are eggs too, but lvl 67-68, so the lvling process is much faster than your eggs in ravenfell. read the first post, its about using the bot to autoattack those eggs, reattack if someone kills them and automatically repair the weapon(s) when dura is near zero.
Re: level up the weapon ability
Posted: Sun May 20, 2012 9:04 am
by pman
rock, it's not possible for me to call the isType() function, can u tell my why this I cannot use it in the onload section?
Edit: it looks like (local mainhand = inventory.EquipSlots[16]) mainhand is no CItem... maybe I have to use another call?
Re: level up the weapon ability
Posted: Sun May 20, 2012 10:00 am
by pman
So, i have played a bit with it, should work.
Edit this two variables to your needs, put your character infront of an egg, and start it. And dont forget to put some simple repair hamers in your bag. Furthermore if you use 2 weapons, the dura of them should be nearly the same... if not, equip the lower dura weapon in the mainhand
Code: Select all
local weapons = 2;
local weapontype = "BLADE"; -- AXE, AXE2H, BLADE, BLUDGEON, CLAYMORE, DAGGER, HAMMER, POLEARM, STAFF, WAND
Re: level up the weapon ability
Posted: Sun May 20, 2012 10:17 am
by rock5
pman wrote:rock, it's not possible for me to call the isType() function, can u tell my why this I cannot use it in the onload section?
Edit: it looks like (local mainhand = inventory.EquipSlots[16]) mainhand is no CItem... maybe I have to use another call?
You are right. isType() is not available to equipment slots. It's really annoying that equipment slots was done as a separate class. The problem is the item class starts with the slot number which is specific to the inventory. If it was based off the address then we could use it for any item located anywhere. I actually started doing work a while ago on making a general item class that other classes could use but it was taking too much time so I didn't finish it. So for instance you would have a inventoryitem class that would use the item class as it's base similar to how the player class uses pawn as it's base. So equipslots would use it as a base too so all the functions would be available and there would be no repetition of code such as there is now. I was also including a bankitem class. Maybe I'll look into that again.
For now maybe we can use an ingame function instead. Nope can't find one. Hm.. Maybe we could trick it into thinking the item is in the inventory. I just tried this and it works.
Code: Select all
inventory.BagSlot[61].Address = inventory.EquipSlots[17].Address
inventory.BagSlot[61]:update()
if inventory.BagSlot[61]:isType("1-Handed Swords") then ...
To restore the inventory slot address just set
Then it will update the address on the next inventory:update()