[Plugin] xAutoDungeon

#1

Forgotten World? Yes.

Use as Script Command like :

...
move,...
AttackArea,15
move,...
move,...
move,...
move,...
move,...
AttackArea,15
move,...
move,...
move,...
AttackArea,15
move,...
...

As you can see at example, it’s attacking one area, then move a few steps to a next area and contiues attacking. 15 means delay (seconds/optional), every 15 seconds check for monsters at that area.

Any feedback (english please) is welcome!

xAutoDungeon v0.0.3

The most recent version will be allocated here

from phBot import *
from threading import Timer

check_mobs_time = 0
isAttacking = False
ignoreGhostCurse = True

# Attack all mobs around using the bot config. Ex: "AttackArea" or "AttackArea,15"
# Will be checking mobs every 15 seconds at this area as default.
def AttackArea(arguments):
	# stop bot and kill mobs through bot or continue script normally
	if getMobCount() > 0:
		# stop scripting
		stop_bot()
		# set automatically the training area
		p = get_position()
		set_training_position(p['region'], p['x'], p['y'])
		# set time
		if len(arguments) == 2:
			check_mobs_time = float(arguments[1])
		#15s as default
		if not check_mobs_time:
			global check_mobs_time
			check_mobs_time = 15.0
		# start to kill mobs on other thread because interpreter lock
		Timer(1.0,AttackMobs).start()
	# otherwise continue normally
	else:
		log("Plugin: Not mobs at this area.")
	return 0

# Attacking mobs using all configs from bot
def AttackMobs():
	if getMobCount() > 0:
		# Start to kill mobs with last training area
		if not isAttacking:
			start_bot()
			global isAttacking
			isAttacking = True
		log("Plugin: Killing ("+str(getMobCount())+") mobs at this area.")
		# Check if there is not mobs to continue the script
		Timer(check_mobs_time,AttackMobs).start()
	else:
		# All mobs killed, stop botting
		stop_bot()
		global isAttacking
		isAttacking = False
		# Setting training area far away. The bot should continue where he was at the script
		set_training_position(0,0,0)
		log("Plugin: All mobs killed. Getting back to the script.")
		start_bot()

# Count all mobs around your character (60 or more it's the max. range I think)
def getMobCount():
	count = 0
	monsters = get_monsters()
	for mob in enumerate(monsters):
		if ignoreGhostCurse and mob["name"].lower() == "ghost curse":
			continue
		count+=1
	return count

log('Plugin: xAutoDungeon v0.0.3 succesfully loaded.')
3 Likes

#2

Short delay time, maybe solve your problem.

Plugin: All mobs killed. Getting back to the script.

That’s how it works. Stop bot > reset training area & continue script!

0 Likes

#3

Just an FYI, I would consider a GitHub repo or even a gist to make things easier.

1 Like

#4

I’il continue with my tests tomorrow. It’s available now!

0 Likes

#5

I was thinking more about a standart repo ago a while, wrapping my plugin collab… Even adding a reference to repl.it where I test some plugins (or part of it) … :male_detective:

But needs to be cleaner, everything, needs time… Soon.jpg :sweat_smile:

0 Likes

#6

I’m testing it right now.

0 Likes

#7

‘’: tuple indices must be integers, not str’’ What is this error?

0 Likes

#8

sorry for my mistake, until now no problems.

0 Likes

#9

It’s fixed now! v0.0.4 actually. Try to download again.

Still not know what’s happening at multiples chars, It should work the same at any player… :face_with_monocle:

0 Likes

#10

ok v4 I’m testing it right now.

0 Likes

#11

its work only dungeons i mean temple 120 baghdad dungeon and how it works we must change script or?

0 Likes

#13

Hmmm…But what you see at phBot? started or stopped? also the training area it’s 0,0 or it’s not changing? that could be an issue at phbot api. I could fix that …

Settings? Nobody kills ghost curse, and it’s not worth … At the moment it’s not neccesary a GUI. Just use return scroll at the end of script it’s the best option, isn’t it? …

0 Likes

#14
  • log:
    [23:45:42] Plugin: Not mobs at this area.
    [23:45:42] Bot started

But the character is just waiting. I will observe to give more information.

-No noo. I mean, Also use this plugin in the Holy Water temple. Continue on our way by cutting off Uniqs by ignoring all other monsters. (Only Syphnix, Nephthys, Horus and Osiris)

0 Likes

#15

What can you see at training area? it’s changing? Also can you see “Bot stopped” right before “Plugin: Not mobs at this area.” ?

Hmm… You want a mob list to avoid in the counter. That’s usefull. Then I’ll add it, soon… :sweat_smile:

0 Likes

#16

I can give you a list of mobs inside holy water temple.

Lightning Khepri
Heron
Keisas
Mhont
Bastet
Bast
Telbasta
Sand Hyena
Chief Hyena
Mummy of Wrath (Maybe we shouldn’t ignore “fn” )
Mummy of Arrogance (Maybe we shouldn’t ignore “fn” )
Statue of Eternal Life (Maybe we shouldn’t ignore “fn” )

“fn”(footnote) : When the monsters are spawn too much, the characters are dying.

0 Likes

#17

Try to use the lastest version from Github :male_detective:

4 Likes

#18

stupid question. but once the plugin is in the correct folder do i need to edit the script to fit my needs for fgw or to even make a leveling script.

0 Likes

#19

you will record a script, and place AttackArea command to the necessary lines

0 Likes

#20

AttackArea,15
move,
move,
script must be like this or coordinates which we are FGW-Baghdad dungeon-Jupiter temple like this

0 Likes

#21

must type “move” not “walk” correct. 15 would be how long it spends searching for mobs?

0 Likes