Integrating Python functions inbetween walk script lines

Hello, Just recently found out that phBot actually supports Python plug-ins which is crazy! :heart:

Anyway, i’ll explain what i’m trying to do in an ordered list:

  1. Make a walk script to move to bunch of coordinates (Working)

  2. Execute a function from the plug-in (works)

  3. Continue the walk script to move to more coordinates (not working)

Step 3 actually works but not as I want it, the bot will try to continue the walk script before the function finishes executing (as far as i know).

I also tried to stop_bot() when the function is triggered, then start_bot() again when the function finishes executing. however, the bot will start the walk script from the beginning without an attemp to continue from where it last reached.

I’m not asking for a fully working solution or a code block. Just hoping to find some tips which might help me solve this :slight_smile: Something like pause_script, and continue_script would do it i guess? what are your thoughts?

example of the code would be:
walk,176,66,243
do_something
walk,185,62,243

since I am making a topic, i’d also like to ask, can I pass arguments to the function from the walk script file? like do_something([1,2,3]) ? if yes, how?

Thank you.

You can add do_somethig,1,2,3 as parameters.
An idea: give next coords to function as params.
do_something,185,62,243
At the end of function add move_to(x,y,z)
Thrn start bot. Then Bot will continue from the next coord.

2 Likes

I realized i can call a function and use wait command, it’s working smoothly. thank you very much!

2 Likes

Have you tried adding a wait command in-between your functions/scripts?