New option idea

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
jpp
Posts: 19
Joined: Mon Jul 05, 2010 2:37 am

New option idea

#1 Post by jpp » Wed Sep 15, 2010 4:25 am

I just thought about possible risk of meeting with GM or having other players trying to caught our bot I realized that may be there is very good method to leave bot for night without any attendance and be sure it is not reported by anyone.
Just one siple question to Admin: Is it possible to detect other players beeing close e.g. in radius of 300 if yes, then just please do add option to stop the bot untill there is someone around! If player is not moving then nobody never asks or worries - does not matten where it stops. If bot is alone then it can do most stupid things - no one will see it.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: New option idea

#2 Post by swietlowka » Wed Sep 15, 2010 5:44 am

to be honest on the place where i bot theres always ppl (crabs) so it wouldn't work for me, but a simple way to see if ppl are around would be usefull for example i'd make a check that on waypoint # if theres some ppl gor for shop or swithc chanel and if no ppl around go another round :) that would make my bot look more human for sure

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

Re: New option idea

#3 Post by Administrator » Wed Sep 15, 2010 6:41 am

Yes, this is possible. I'm just not entirely sure how it would best be implemented. I suppose the best route would be to continue the current action (if running to a waypoint, continue until you reach it; if fighting, kill any aggressive monsters, etc.) before entering a "resting" state.

This would be disabled by default, of course.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: New option idea

#4 Post by swietlowka » Wed Sep 15, 2010 7:19 am

just make it possible to check for nearby ppl, and from them we could scirp it to rest on waypoint without a problem imho :)

fred55555
Posts: 101
Joined: Sat Aug 07, 2010 7:57 pm

Re: New option idea

#5 Post by fred55555 » Wed Sep 15, 2010 3:05 pm

The stop and change channel is a good idea.
You could also call a safe spot waypoint file the character will run to were there is no spawn
Or on detect time to sell/repair the continue

or you could setup al three and setup a random string to select one of them to do on detect

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

Re: New option idea

#6 Post by rock5 » Wed Sep 15, 2010 8:03 pm

I think what people choose to do if other players are near by is up to them. What I think is need, as swietlowka said, is just a function that people can run to see if any players are nearby. Maybe with an argument of the range you want to check.
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: New option idea

#7 Post by Administrator » Wed Sep 15, 2010 8:49 pm

Here's an addon for that. Save the file to your userfunctions folder.

Use:

Code: Select all

if( player:isHumanInRange(400) ) then
  -- do something
end
Attachments
addon_player.lua
(1007 Bytes) Downloaded 204 times

redcrux
Posts: 5
Joined: Tue Jul 14, 2009 9:28 pm

Re: New option idea

#8 Post by redcrux » Fri Sep 17, 2010 12:27 am

in the

-- Do Something

part, what option would i have to enable so that the bot would stop moving and stop aquiring targets, but still defend itself if its attacked, kinda like the RUN option but without the running lol

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: New option idea

#9 Post by MiesterMan » Fri Sep 17, 2010 1:07 pm

If that's what you want replace "-- do something" with "player:rest(60);". That way it will rest for 60 seconds only fighting back if attacked and if the person is still there it'll rest for 60 seconds again. Feel free to make it longer, like 300 for 5 minutes. Or if you want it to not move until you get back accept for fighting back against aggros you can use "player:sleep();" which will have your char in rest mode until you resume.

jpp
Posts: 19
Joined: Mon Jul 05, 2010 2:37 am

Re: New option idea

#10 Post by jpp » Tue Sep 21, 2010 8:35 am

Did it and works perfectly until now.
Used code:

Code: Select all

function pw(_harvest)
   _harvest = _harvest or false;
   if (_harvest) then
      player:harvest();
   end
   restc = 0;
   while ( player:isHumanInRange(400) and restc<5 ) do
      player:rest(60);
      restc = restc + 1;
   end
   return true;
end
so it waits but not forever. Just need to avoid crowded places not to waste too much time.
Every waypoint need to have pw(true); or pw(false); depending if we harvest or not there.
Also did small fix in isHumanInRange:

Code: Select all

	local function isInDist(x1, y1, x2, y2, radius)
		if( x2 >= x1-radius and x2 <= x1+radius and
			y2 >= y1-radius and y2 <= y1+radius ) then
                           return true;
			--if( ((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)) <= radius*radius ) then
			--	return true;
			--else
			--	return false;
			--end
		end

		return false;
	end
that means in this case it does not matter if distance is computed exactly - approx range should be enough and processing time is more decreased.

vo2male
Posts: 122
Joined: Mon Aug 27, 2012 6:41 am

Re: New option idea

#11 Post by vo2male » Sun Jan 20, 2013 9:55 am

Hi! Sorry for reviving an old topic but this is still pretty useful..id just like to ask if someone can update this? it works.. but when i tried my alt to get near to my other character (which are both friends with) the bot still stops.. i thought that this won't stop as long as you are friends with a player which is near you.

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

Re: New option idea

#12 Post by rock5 » Sun Jan 20, 2013 10:09 am

I don't see anything about friends.

There is also my countplayers function
http://www.solarstrike.net/phpBB3/viewt ... 781#p36781
but that doesn't consider friends either.

One of them would have to be modified just for you. Although there are probably others that might find it useful 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

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

Re: New option idea

#13 Post by rock5 » Sun Jan 20, 2013 10:31 am

I decided it was a useful option so I added it to my function at the above link.
  • 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

vo2male
Posts: 122
Joined: Mon Aug 27, 2012 6:41 am

Re: New option idea

#14 Post by vo2male » Sun Jan 20, 2013 11:39 am

thanks rock for this.. i got a little idea about it.. so basically what i did is this but i still have to test it.

Code: Select all

function checkcrowd()
		if CountPlayers(300, printnames, ignorefriends) > 1 then
			print("Waiting till it's less crowded")
			repeat
			yrest(5000)
		until 2 > CountPlayers(nil,true) 
	end
end
hmm i think i misinterpreted those arguments..
Arguments:
inrange - The range in which you want to count the players. Optional. If omitted, it will count all players it can detect.
printnames - If true, prints the names of the players. I find this useful if creating a wait loop so I can see how the names change over time while I wait.
ignorefriends - If true, does not include friends in the count. 'Friends' includes names in your profile friends list, party members if in a party and warden pet if you have one.

Code: Select all

if CountPlayers(300, true, true) 
should i put it this way instead?


what does this line mean?

Code: Select all

 until 2 > CountPlayers(nil,true) 
end
can i just add this instead?

Code: Select all

 until 0 == CountPlayers(nil,true) 
end

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

Re: New option idea

#15 Post by rock5 » Sun Jan 20, 2013 1:13 pm

vo2male wrote:

Code: Select all

if CountPlayers(300, true, true)

should i put it this way instead?
Correct.
vo2male wrote:what does this line mean?

Code: Select all

 until 2 > CountPlayers(nil,true)
end
The 'until' is the end of the repeat loop. The 'end' is the end of the 'if' statement.

Basically what that code says is, if the number of players is more than 1 then wait until the number of players is less than 2 using a repeat loop.

If you want to wait even when there is only one player then you would use.

Code: Select all

function checkcrowd()
	if CountPlayers(300, nil, true) > 0 then
		print("Waiting till it's less crowded")
		repeat
			yrest(5000)
		until 1 > CountPlayers(300,true,true)
	end
end
Note: I used nil for the second argument in the 'if' statement because I don't want it to print player names until that 'if' statement returns true.
vo2male wrote:can i just add this instead?

Code: Select all

 until 0 == CountPlayers(nil,true)
Well you could use

Code: Select all

		until 0 == CountPlayers(300,true,true)
It's the same thing.
  • 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

vo2male
Posts: 122
Joined: Mon Aug 27, 2012 6:41 am

Re: New option idea

#16 Post by vo2male » Sun Jan 20, 2013 4:18 pm

i have an error

Code: Select all

0:14am - ...scripts/rom/userfunctions/userfunction_countmobs.lua:38: attempt to
call method 'isFriend' (a nil value)
one more thing, is it right that there should be no spaces b/w these?

Code: Select all

(300,true,true)

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

Re: New option idea

#17 Post by rock5 » Sun Jan 20, 2013 9:45 pm

Sorry, 'isFriend' is a new pawn function in RC3. It was an easy way to add a friend check to the userfunction. You could try the RC3 version or wait until I commit it. I should be committing it soon.
  • 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

vo2male
Posts: 122
Joined: Mon Aug 27, 2012 6:41 am

Re: New option idea

#18 Post by vo2male » Mon Jan 21, 2013 3:38 am

i tried with the RC3 version but still doesnt work

i put my alt there near my bot.. their strangers..and he just keeps going
btw they are both in the same guild..

EDIT***
tried to put my another alt ( different guilds/not friends) does not also work as it should

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

Re: New option idea

#19 Post by rock5 » Mon Jan 21, 2013 4:05 am

So were you using this code?

Code: Select all

function checkcrowd()
   if CountPlayers(300, nil, true) > 0 then
      print("Waiting till it's less crowded")
      repeat
         yrest(5000)
      until 1 > CountPlayers(300,true,true)
   end
end
Did you put it in the onload of the waiypoint file? Did you then use 'checkcrowd()' in your waypoints? Did it print any names?
  • 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

vo2male
Posts: 122
Joined: Mon Aug 27, 2012 6:41 am

Re: New option idea

#20 Post by vo2male » Mon Jan 21, 2013 4:07 am

this is on my onload

Code: Select all

function checkcrowd()
		if CountPlayers(300,true,true) > 1 then
			print("Waiting till it's less crowded")
			repeat
			yrest(3000)
		until 0 == CountPlayers(300,true,true) 
	end
end
this is on my waypoints 1 and 2

Code: Select all

checkcrowd()
it only printed names..but didn't rest

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest