Rock5's catchCavy script

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Rock5's catchCavy script

#1 Post by rock5 » Wed Aug 25, 2010 2:12 am

Here's my function for catching Cavys. Add it to your 'rom/userfunctions' folder.

Usage:
In the <onLeaveCombat> section of your profile add the following command.

Code: Select all

catchCavy()
This will default to only catching "Golden Magic Cavy"s. New! This will now work in any language client.

If you want to catch all cavys then use

Code: Select all

catchCavy("cavy")
'cavy' is a code word that will be replaced with the IDs of both the golden and regular cavys so it will work in any language client.

Make sure you have enough traps and be careful in areas with a lot of obstacles as they may get in the way.

Features:
  • Wont catch the cavy until all aggro mobs have been cleared.
  • Breaks from catching the cavy if being attacked and health falls below 50% (Can be customized by changing 'hpper' option at top of the file).
  • Sounds a bell to let you know when catching a cavy (can be turned off by setting the 'soundbell' option to false at the top of the file).
Attachments
userfunction_catchcavy.lua
Version 1.03 - Added catch distance limit to MAX_TARGET_DIST
- Reduced herding distance to 40
- Added soundbell option
(2.4 KiB) Downloaded 394 times
Last edited by rock5 on Fri Aug 27, 2010 10:41 am, edited 3 times in total.
  • 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

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: Rock5's catchCavy script

#2 Post by Starrider » Wed Aug 25, 2010 1:17 pm

Thx I'll test it.
Am I rigth that I have to create the userfunctions.lua for my own, because i didn't find in the directories.
I put the code in this created file. Must i put this in the main \rom script directory, where the bot.lua etc. is?

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

Re: Rock5's catchCavy script

#3 Post by Administrator » Wed Aug 25, 2010 1:59 pm

If you've got the latest version (r495) off SVN, you should have a userfunctions directory. Create a file named addon_catchcavy.lua in there (instead of userfunctions.lua) and paste the code into this new file.

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#4 Post by pctd » Wed Aug 25, 2010 9:32 pm

tested 2 hour, not working.. add 2 second before catching also. can see the 2 sec delay, but no catching, please update script :D

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

Re: Rock5's catchCavy script

#5 Post by rock5 » Wed Aug 25, 2010 10:53 pm

pctd wrote:tested 2 hour, not working.. add 2 second before catching also. can see the 2 sec delay, but no catching, please update script :D
I never actually watched it catch myself. I always just came back and saw some traps missing and the amount that were missing is the amount of eggs I had. I caught about 5 Golden Magic Cavys. I can set it to catch normal ones and try to see what is wrong but I need a better description.

Did it ring the bell?
Did it drop the trap?
Did it try to herd the Cavy?
Did the trap catch the cavy?
  • 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

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#6 Post by pctd » Wed Aug 25, 2010 11:36 pm

rock5 wrote:
pctd wrote:tested 2 hour, not working.. add 2 second before catching also. can see the 2 sec delay, but no catching, please update script :D
I never actually watched it catch myself. I always just came back and saw some traps missing and the amount that were missing is the amount of eggs I had. I caught about 5 Golden Magic Cavys. I can set it to catch normal ones and try to see what is wrong but I need a better description.

Did it ring the bell?
Did it drop the trap?
Did it try to herd the Cavy?
Did the trap catch the cavy?
no ringing bell
no droping trap
no reponse when cavy appears (but character wait for delay set time)
no trap drop => no catching

i thought early game update has involved this result

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

Re: Rock5's catchCavy script

#7 Post by rock5 » Thu Aug 26, 2010 12:12 am

pctd wrote:no ringing bell
no droping trap
no reponse when cavy appears (but character wait for delay set time)
no trap drop => no catching

i thought early game update has involved this result
There was a small error in the function. Download it again from the first post and try it. I don't think it was your problem because it should have caused an error. If it didn't beep and display "Attempting to catch cavy..." then it didn't detect a valid cavy.

If you still have problems please show me how you are using the command. And how many traps do you have in your inventory?
  • 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

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#8 Post by pctd » Thu Aug 26, 2010 2:38 am

rock5 wrote:There was a small error in the function. Download it again from the first post and try it. I don't think it was your problem because it should have caused an error. If it didn't beep and display "Attempting to catch cavy..." then it didn't detect a valid cavy.

If you still have problems please show me how you are using the command. And how many traps do you have in your inventory?
i have fixed your function before testing , it's a typing bug ")", instead of "}". But still not work..

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

Re: Rock5's catchCavy script

#9 Post by rock5 » Thu Aug 26, 2010 2:58 am

pctd wrote:i have fixed your function before testing , it's a typing bug ")", instead of "}". But still not work..
You didn't answer my questions.
rock5 wrote:If you still have problems please show me how you are using the command. And how many traps do you have in your inventory?
  • 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

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#10 Post by pctd » Thu Aug 26, 2010 4:49 am

rock5 wrote:
pctd wrote:i have fixed your function before testing , it's a typing bug ")", instead of "}". But still not work..
You didn't answer my questions.
rock5 wrote:If you still have problems please show me how you are using the command. And how many traps do you have in your inventory?
I followed your instruction (copy it to userfuntions.lua , add function catchCavy() to OnLeaveCombat). The script runs normally without bug, but no ringing, no dropping trap. I have 80 traps in my inventory, and nothing used.. It seems no action seen from Bot to see it working, except there's a delay of preconfiged delay time 2 seconds.

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

Re: Rock5's catchCavy script

#11 Post by rock5 » Thu Aug 26, 2010 5:26 am

pctd wrote:I followed your instruction (copy it to userfuntions.lua , add function catchCavy() to OnLeaveCombat). The script runs normally without bug, but no ringing, no dropping trap. I have 80 traps in my inventory, and nothing used.. It seems no action seen from Bot to see it working, except there's a delay of preconfiged delay time 2 seconds.
catchCavy() will by default only catch the very rare "Golden Magic Cavy". Most cavys you see are "Magic Cavy"s. If you want to catch them you will have to use catchCavy("Cavy") to catch all cavys.

If you added the function to the userfunctions.lua file I assume that means you haven't updated to the latest SVN yet? If you have updated, you should see a 'addons' folder in your rom folder. If so, you will have to use the 'addon_catchcavy.lua' file and place it in the addon folder.

I don't understand the 2 second pause. If the bell didn't sound then the function didn't run or it didn't detect a valid cavy. Either way there should be no extra pauses except for a .2 second pause. Are you sure it isn't the same when you don't use the function?
  • 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: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rock5's catchCavy script

#12 Post by Administrator » Thu Aug 26, 2010 6:26 am

The bell will only sound if a system speaker is hooked up to the motherboard. Many people don't bother with them anymore. I know I didn't bother putting mine in when I built this computer.

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#13 Post by pctd » Thu Aug 26, 2010 8:03 am

Administrator wrote:The bell will only sound if a system speaker is hooked up to the motherboard. Many people don't bother with them anymore. I know I didn't bother putting mine in when I built this computer.
thnx for reminding me, but i hooked it, tested with new svn 495, continue fail.. so weird, i'm sure the function was called, but not understand why it does not work
i have yrest(3000); to be sure the fight finished to proceed to catch cavy, but the bot just rests 3 secs, and then nothing happen.. if this works on your pc, it should be good on mine, hic..

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

Re: Rock5's catchCavy script

#14 Post by rock5 » Thu Aug 26, 2010 8:20 am

pctd wrote:
Administrator wrote:The bell will only sound if a system speaker is hooked up to the motherboard. Many people don't bother with them anymore. I know I didn't bother putting mine in when I built this computer.
thnx for reminding me, but i hooked it, tested with new svn 495, continue fail.. so weird, i'm sure the function was called, but not understand why it does not work
i have yrest(3000); to be sure the fight finished to proceed to catch cavy, but the bot just rests 3 secs, and then nothing happen.. if this works on your pc, it should be good on mine, hic..
I'm running out of ideas. If nothing I've suggested has helped then I don't know what to say. All I can do is repeat, if it is called but nothing happens then that means it didn't find a matching cavy. What did you put between the brackets? ie. catchCavy("what did you put here?")
  • 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

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#15 Post by pctd » Thu Aug 26, 2010 8:36 am

rock5 wrote:
pctd wrote:
Administrator wrote:The bell will only sound if a system speaker is hooked up to the motherboard. Many people don't bother with them anymore. I know I didn't bother putting mine in when I built this computer.
thnx for reminding me, but i hooked it, tested with new svn 495, continue fail.. so weird, i'm sure the function was called, but not understand why it does not work
i have yrest(3000); to be sure the fight finished to proceed to catch cavy, but the bot just rests 3 secs, and then nothing happen.. if this works on your pc, it should be good on mine, hic..
I'm running out of ideas. If nothing I've suggested has helped then I don't know what to say. All I can do is repeat, if it is called but nothing happens then that means it didn't find a matching cavy. What did you put between the brackets? ie. catchCavy("what did you put here?")
catchCavy("Magic Cavy")

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

Re: Rock5's catchCavy script

#16 Post by rock5 » Thu Aug 26, 2010 9:18 am

pctd wrote:catchCavy("Magic Cavy")
That should work and I've run out of ideas. Let me re-list everything I can think of that could stop it from working so you can double check
  • You've updated to 495. Are you using the 'addon_catchcavy.lua' file or are you still using 'userfunctions.lua'?
  • You said you have traps. Are they in the 1st or 2nd bag?
  • You are using catchCavy("Magic Cavy"). Are you using an English client?
That's everything I can think of.
  • 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

pctd
Posts: 7
Joined: Thu Jul 08, 2010 10:35 pm

Re: Rock5's catchCavy script

#17 Post by pctd » Thu Aug 26, 2010 9:36 am

rock5 wrote:
pctd wrote:catchCavy("Magic Cavy")
That should work and I've run out of ideas. Let me re-list everything I can think of that could stop it from working so you can double check
  • You've updated to 495. Are you using the 'addon_catchcavy.lua' file or are you still using 'userfunctions.lua'?
  • You said you have traps. Are they in the 1st or 2nd bag?
  • You are using catchCavy("Magic Cavy"). Are you using an English client?
That's everything I can think of.
you really rock :mrgreen: SOLVED continue testing how it works , ty :lol:

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

Re: Rock5's catchCavy script

#18 Post by rock5 » Thu Aug 26, 2010 9:41 am

pctd wrote:
rock5 wrote:
pctd wrote:catchCavy("Magic Cavy")
That should work and I've run out of ideas. Let me re-list everything I can think of that could stop it from working so you can double check
  • You've updated to 495. Are you using the 'addon_catchcavy.lua' file or are you still using 'userfunctions.lua'?
  • You said you have traps. Are they in the 1st or 2nd bag?
  • You are using catchCavy("Magic Cavy"). Are you using an English client?
That's everything I can think of.
you really rock :mrgreen: SOLVED continue testing how it works , ty :lol:
I see you highlighted the second line so I assume that was your problem. I've had that problem before. I should really remember to make that one of my first suggestions. :)
  • 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: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rock5's catchCavy script

#19 Post by Administrator » Thu Aug 26, 2010 10:27 am

Or, perhaps, we should change the default bag searching to check all 6 bags now that we're using the new inventory system. It shouldn't cause any slowness, right?

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

Re: Rock5's catchCavy script

#20 Post by rock5 » Thu Aug 26, 2010 10:39 am

Administrator wrote:Or, perhaps, we should change the default bag searching to check all 6 bags now that we're using the new inventory system. It shouldn't cause any slowness, right?
You're probably right but people may also put things in the transmutor. It would be good if it checked there too.
  • 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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 9 guests