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

Re: Rock5's catchCavy script

#81 Post by rock5 » Tue Mar 29, 2011 7:46 pm

"\a" is a special code that rings the case bell. So the bell rings trice on this line.

Code: Select all

		cprintf(cli.yellow,"\a\aAttempting to catch cavy...\n")
  • 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

AngelDrago
Posts: 133
Joined: Fri May 06, 2011 10:39 am

Re: Rock5's catchCavy script

#82 Post by AngelDrago » Sat May 07, 2011 11:59 am

newby question how do you execute the script or is the script auto execute :?: :?:

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

Re: Rock5's catchCavy script

#83 Post by rock5 » Sat May 07, 2011 12:14 pm

Just follow the instructions on the first post.
  • 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

vietales
Posts: 48
Joined: Sun Apr 17, 2011 12:57 pm

Re: Rock5's catchCavy script

#84 Post by vietales » Fri Jun 03, 2011 5:48 am

I have created userfunctions.lua in the "rom" folder my own and pasted your script into this new file.


Using

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
		catchCavy();
	]]></onLeaveCombat>

=> After 30mins Golden cavy appeared but nothing happened

and

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
		catchCavy("cavy");
	]]></onLeaveCombat>
=> Received this error

Code: Select all

...esktop/micromacro_475/scripts/rom/classes/player.lua:1088: Error in your profile: onLeaveCombat error: ...esktop/micromacro_475/scripts/rom/classes/player.lua:2779: bad argument #2 to 'find' (string expected, got table)
My svnversion is 475
Rock, help me!

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

Re: Rock5's catchCavy script

#85 Post by rock5 » Fri Jun 03, 2011 10:43 am

vietales wrote:I have created userfunctions.lua in the "rom" folder my own and pasted your script into this new file.


Using

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
		catchCavy();
	]]></onLeaveCombat>

=> After 30mins Golden cavy appeared but nothing happened
I think that should have worked. Do you have huntman traps and are they in your backpack?
vietales wrote:and

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
		catchCavy("cavy");
	]]></onLeaveCombat>
=> Received this error

Code: Select all

...esktop/micromacro_475/scripts/rom/classes/player.lua:1088: Error in your profile: onLeaveCombat error: ...esktop/micromacro_475/scripts/rom/classes/player.lua:2779: bad argument #2 to 'find' (string expected, got table)
My svnversion is 475
Rock, help me!
Your version doesn't supports tables in the findNearestNameOrId function. Delete these lines near the top of the catchcavy userfunction,

Code: Select all

	if string.lower(_cavy) == "cavy" then -- Look for all cavies
		_cavy = {103566,103567}
	end
You wont be able to use the "cavy" keyword. You will have to specify what to search for.

For example:

Code: Select all

catchCavy() -- Will catch only Golden Magic Cavy in any client language.
catchCavy("Cavy") -- In English will catch both Golden Magic Cavy and Magic 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

vietales
Posts: 48
Joined: Sun Apr 17, 2011 12:57 pm

Re: Rock5's catchCavy script

#86 Post by vietales » Fri Jun 03, 2011 12:14 pm

So weird, catchCavy("Cavy") still not working even there are 3 cavies around me
Do I have to set loot = true in my profile?
Attachments
2011.06.04_Pic_06.jpg

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

Re: Rock5's catchCavy script

#87 Post by rock5 » Fri Jun 03, 2011 12:55 pm

I can't see why it doesn't work, sorry.
  • 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

vietales
Posts: 48
Joined: Sun Apr 17, 2011 12:57 pm

Re: Rock5's catchCavy script

#88 Post by vietales » Fri Jun 03, 2011 1:37 pm

rock5 wrote:I can't see why it doesn't work, sorry.
.. so sad :(

vietales
Posts: 48
Joined: Sun Apr 17, 2011 12:57 pm

Re: Rock5's catchCavy script

#89 Post by vietales » Sat Jun 04, 2011 5:55 am

I have made a function named CavyDetect to find out if a cavy spawn or not

Code: Select all

function CavyDetect(_cavy)
	_cavy = _cavy or 103566 or 103567
	local cavy = player:findNearestNameOrId(_cavy)
	if cavy then cprintf(cli.yellow,"\a\aMagic Cavy detected...\n") end
end
but nothing happen when a Cavy spawn

So, Do you think r475 has some problem with 'findNearestNameOrId' function?

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

Re: Rock5's catchCavy script

#90 Post by rock5 » Sat Jun 04, 2011 7:35 am

Yes, looks like there was a target "type" limitation that was removed in 477. 477 comments actually say "Can now target Cavys" so I'd say try 477. There are only 2 minor changes between 475 and 477 so it should work.
  • 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

vietales
Posts: 48
Joined: Sun Apr 17, 2011 12:57 pm

Re: Rock5's catchCavy script

#91 Post by vietales » Sat Jun 04, 2011 10:12 pm

rock5 wrote:Yes, looks like there was a target "type" limitation that was removed in 477. 477 comments actually say "Can now target Cavys" so I'd say try 477. There are only 2 minor changes between 475 and 477 so it should work.
Oh god, it works like a charm !
You're really rock, rock :D

harbifm
Posts: 135
Joined: Wed May 25, 2011 11:43 pm

Re: Rock5's catchCavy script

#92 Post by harbifm » Sun Jun 05, 2011 1:12 am

can you explain vitales how you made it work with 477 step by step? (begin with creating userfucntion.lua)

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

Re: Rock5's catchCavy script

#93 Post by lisa » Sun Jun 05, 2011 3:13 am

harbifm wrote:can you explain vitales how you made it work with 477 step by step? (begin with creating userfucntion.lua)
The issues and problems you are having and will continue to have are very specific to the server/revision you are using. Please post your requests and such in this topic created especially for your server.
http://www.solarstrike.net/phpBB3/viewt ... =30&t=2538

I would rather not see the forum filled up with questions and problems that only a small % of the users will actually encounter, if we keep the issues in one place then it will help you all out that use the same server/revision.
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
Edamh
Posts: 106
Joined: Tue May 24, 2011 11:56 pm

Check for bag space before use?

#94 Post by Edamh » Mon Jun 06, 2011 6:54 am

I quickly skimmed the 5 pages of posts but I didn't see anything about a check for bag space BEFORE using the function. I guess that my bags were full when the golden cavies spawned, bot used a trap, but no egg in bag since bags full. There were 3 traps/eggs unaccounted for in my bags last night.

Can I use the following?

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
                if inventory:itemTotalCount(0) > 0 then catchCavy()
	]]>
or am I missing (semi)colon in there or other syntax? Thanks.

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

Re: Rock5's catchCavy script

#95 Post by lisa » Mon Jun 06, 2011 7:17 am

the check for bag space seems fine, you need an end to close the if statement though ;)

Code: Select all

 if inventory:itemTotalCount(0) > 0 then catchCavy() end
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
omegastar013
Posts: 15
Joined: Sat Jul 09, 2011 11:29 am
Location: prisonplanet

Re: Rock5's catchCavy script

#96 Post by omegastar013 » Sat Jul 09, 2011 5:14 pm

thank you for this rock5

testbot
Posts: 3
Joined: Sat Oct 08, 2011 2:46 am

Re: Rock5's catchCavy script

#97 Post by testbot » Sat Oct 08, 2011 2:54 am

Dont work for me, (Rev 654)

9:38am - C:/micromacro/scripts/rom/classes/player.lua:1423: Error in your profile: onLeaveCombat error: [string "..."]:3: attempt to call global 'catchCavy' (anil value)

thx for all.

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

Re: Rock5's catchCavy script

#98 Post by lisa » Sat Oct 08, 2011 3:32 am

That is telling you that you don't have the userfunction in the userfunctions folder.
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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Rock5's catchCavy script

#99 Post by botje » Thu Nov 01, 2012 3:51 am

just posting here to give a heads up on the fact this is still broken :)

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

Re: Rock5's catchCavy script

#100 Post by rock5 » Thu Nov 01, 2012 4:28 am

botje wrote:just posting here to give a heads up on the fact this is still broken :)
Really? I wasn't aware it was broken.
  • 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: No registered users and 10 guests