Page 1 of 3

My little helper

Posted: Fri Jan 07, 2011 2:53 pm
by JackBlonder
This is my waypointfile to let a healer follow the party and heal if necessary.
Maybe some of you like it. I'm just a noob in Rombot and LUA.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
		local partymember={}
		local partymemberName={}
		local partymemberObj={}
		local noofpartymembers
		local i	

		
--********************************************************
--get all partymembers
--********************************************************
	if RoMScript("UnitExists('party1')") then
		table.insert(partymemberName, RoMScript("UnitName('player')"))
		i = 1
		while not(i >= 7 ) do
			if RoMScript("UnitIsPlayer('party"..i.."');") then
				table.insert(partymemberName,i+1, RoMScript("UnitName('party"..i.."')"))
			end
			i = i + 1
		end
		
		noofpartymembers = #partymemberName
		
		for i,v in ipairs(partymemberName) do
			table.insert(partymemberObj,i,player:findNearestNameOrId(partymemberName[i]))
			table.insert(partymember,i,CPawn(partymemberObj[i].Address))
		end
	end
--********************************************************
--Look at partymember health and heal if necessary 	
--********************************************************
	while(true) do
		for i,v in ipairs(partymember) do
			partymember[i]:update()

			if (90 > partymember[i].HP/partymember[i].MaxHP*100 and partymember[i].HP/partymember[i].MaxHP*100 > 50) then
				player:target(partymember[i])
			--**********Put year casts here*********************
				yrest(300)
			elseif (50 > partymember[i].HP/partymember[i].MaxHP*100) then
				player:target(partymember[i])
			--**********and here*********************
				yrest(300)
			--**********and so on*********************
			end
		end
		
		yrest(100)
		RoMScript("FollowUnit('party1');");
	end
	</onLoad>
</waypoints>

Re: My little helper

Posted: Fri Jan 07, 2011 6:36 pm
by rock5
I changed your quote tags to code tags.

That's a nice bit of neat coding for someone who's "a noob in Rombot and LUA". I look forward to seeing your future contributions.

Re: My little helper

Posted: Sat Jan 08, 2011 7:34 pm
by top1
sweet tomorow I'll have a closer look at this!

could help by my healing problem :)

Re: My little helper

Posted: Sun Jan 09, 2011 12:51 pm
by schwarzepeter
**********Put year casts here*********************??

can u please make a example ho to wrihte the skill in it sorry i dont get it to work :s

Re: My little helper

Posted: Sun Jan 09, 2011 1:01 pm
by wizzyslo

Code: Select all

player:cast("MAGE_PURGATORY_FIRE"); yrest(1000); 
Skill must be on your profile to.

Re: My little helper

Posted: Mon Jan 10, 2011 8:48 am
by jduartedj
Maybe you could make this a file and add it to the addons,scripts forum and wiki repository? Good coding gz!

Re: My little helper

Posted: Tue Jan 11, 2011 4:34 am
by JackBlonder
I added a link to the addon repo.
Here's the waypointfile with two priest casts

Re: My little helper

Posted: Tue Jan 11, 2011 6:40 am
by rock5
Could you please add it to the first post? That way it doesn't get lost in the discussion.

Re: My little helper

Posted: Fri Jan 14, 2011 2:50 am
by swietlowka
anyway for it to autoloot bodies and then follow leader?

Re: My little helper

Posted: Fri Jan 14, 2011 3:04 am
by lisa
You could try adding in the usage of rock5's loot bodies and then tell it to follow again after.

http://www.solarstrike.net/phpBB3/viewt ... =27&t=2018

Re: My little helper

Posted: Fri Jan 14, 2011 3:34 am
by swietlowka
of that im aware, maybe it wasnt really good spoken at first, i mean when theres a bot running the leader can just move while heal is looting... was thinking of some kind of a command to let the leader bot know that it have to wait xD

Re: My little helper

Posted: Fri Jan 14, 2011 4:00 am
by lisa
Someone made a post about party botting and they used to use buffs as a way to communicate between diff characters. So when priest is ready it casts a buff on tank, tank recognizing it has the specific buff, removes it and continues on.

Re: My little helper

Posted: Fri Jan 14, 2011 4:09 am
by swietlowka
oh i did not see it, but it seems reasonable... if we could make the bot somehow read from chat it would be much easier to handle though ;0

Re: My little helper

Posted: Fri Jan 14, 2011 4:36 am
by lisa
Actual chat is monitored by a programme for the GM's to use. When you say specific words in any channel it is added to a log file which GM's have to read through to see if they were needed and anything else like "hey I'm a bot".

I wouldn't try to use any chat channels in regards to the bot.

Re: My little helper

Posted: Fri Jan 14, 2011 4:40 am
by swietlowka
if the key words would be editable it wouldnt matter f/e
"hey w8 i need to grab stuff, plox" i doubt it would look any suspicous to htat program, but anyway, ill use the buffs for that matter easy and friendly solution

Re: My little helper

Posted: Fri Jan 14, 2011 4:55 am
by lisa
If you made the function that calls for anything by other bot as a table and the full table means you get the response you want then it might work. If 1 character says "Hey wait" every few minutes for hours on end it would look suspicious.
It would be possible to make the bot use chat channels for commands, it would bog down the bot a little though. Already many addons for group invites which monitor defined channels for spefic characters and then responding to them.

I'm not saying it isn't doable just saying if you didn't do it properly then it would just paint a big target on your head saying "I am a bot, bann me". Doing it "properly" would take a while.

Re: My little helper

Posted: Fri Jan 14, 2011 5:42 am
by swietlowka
lisa wrote:If you made the function that calls for anything by other bot as a table and the full table means you get the response you want then it might work. If 1 character says "Hey wait" every few minutes for hours on end it would look suspicious.
It would be possible to make the bot use chat channels for commands, it would bog down the bot a little though. Already many addons for group invites which monitor defined channels for spefic characters and then responding to them.

I'm not saying it isn't doable just saying if you didn't do it properly then it would just paint a big target on your head saying "I am a bot, bann me". Doing it "properly" would take a while.
so true...

Re: My little helper

Posted: Fri Jan 14, 2011 7:26 am
by rock5
Plus the bot isn't designed to monitor any events in the game like the CHAT_MSG events. You would need an ingame addon.

Re: My little helper

Posted: Fri Jan 14, 2011 2:19 pm
by JackBlonder
Short solution without buff communication

Code: Select all

		lootBodies()
		yrest(100)
		
		partyleader:update()
		if ( distance(player.X, player.Z, partyleader.X, partyleader.Z) > 200) then
				player:moveTo(CWaypoint(partyleader.X, partyleader.Z), true)
		end
		RoMScript("FollowUnit('party1');");
The buff communication is a nice idea though.

Re: My little helper

Posted: Sat Jan 15, 2011 9:46 pm
by jduartedj
rock5 shouldn't this thread be moved to addons?