Execute script via plugin

Hey there
I’m writing a very simple plugin that will run a script from a txt file when a GUI button is pressed

I couldn’t find what I was looking for in the API so figured I’d ask.

I want to know how to execute the script from the file, just like a condition would do.

The picture clearly shows what my intention is.

Ty vm.

To change town script, you’ll have to move the scripts (add and/or remove depends which is the case) the script file from Town folder.

To change training script you can check the API reference:
https://projecthax.gitbook.io/phbot-plugins/phbot-api/training-area#set_training_script

I’m not trying to change the Town or training scripts.

What I want is to run a script from a .txt just like you can do with conditions.

Right now I have the bot set up to execute the script in the txt file at a certain time, but since chances are the bot is in the queue at the time I want to create this plugin to run this same script on demand.

@Ryan @JellyBitz

You cant just simply execute from a script i dont believe. My guess is youll have to make some kind of for loop that reads line by line in your script. Never done it, just an idea.