Script command

Hi Phbot users,
i need a cooment to change script in a scipt
for example i did a trading script from jangan to hotan
after i give the goods i set that the bot unequip the job suit
after that i want that the bot change the script automatically that the char walk to the spot
any1 can help me ?
pls

I don’t think there’s a command to do that. You could do it through Python though.

is it hard to add in script ?

set_training_script(path)

Read this Site about Python:
https://projecthax.gitbook.io/phbot-plugins/

@Ryan
set_training_script is not on gitbook. Can you update it?

Added. Really wish they’d just let me edit the markdown like before instead of this trash user interface.

1 Like

i need to more active here thx <3

@OmaWolle This may works, not sure:

from phBot import *
from threading import Timer
import os

# Change script through script command "change_script,c:\phbot\script\movoi.txt"
def change_script(args):
	argCount = len(args)
	# check params
	if argCount >= 2:
		# set path
		path = args[1]
		# check script existence
		if os.path.exists(path):
			# stop bot
			stop_bot()
			# set script
			log('Plugin: Script path changed to ['+path+']')
			set_training_script(path)
			# start bot in other thread
			Timer(1.0,start_bot).start()
	return 0
1 Like