Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new links between commands : when, until, ... #20

Open
2 of 3 tasks
rom1504 opened this issue Feb 7, 2013 · 10 comments
Open
2 of 3 tasks

new links between commands : when, until, ... #20

rom1504 opened this issue Feb 7, 2013 · 10 comments

Comments

@rom1504
Copy link
Owner

rom1504 commented Feb 7, 2013

It would be nice to be able to do this kind of thing :

  • when <event> do <task>
  • repeat <task> until <condition>
  • if <condition> do <task>

The syntax of these things might change, I'm not sure what would be really useful.
It would be useful to add examples, to know what is really useful.

@andrewrk
Copy link

andrewrk commented Feb 7, 2013

whoa, meta programming! I never thought to try to do that with a bot. I wonder what you might try to do. Hm.

@andrewrk
Copy link

andrewrk commented Feb 7, 2013

Maybe "when you have low food, eat food"

@vogonistic
Copy link

If you have available tasks that can provide functionality, you could have implied actions.

"ensure not hungry" could mean, check isHungry() {this.food < 5} periodically and if it triggers, it looks for something that provides food and picks one of the ways.

@rom1504
Copy link
Owner Author

rom1504 commented Feb 8, 2013

vogonistic: yes, maybe i could do an event hungry and then use when hungry do get food or something like that (food would need to be implemented)
or maybe I could simply implement an ensure yes

@rom1504
Copy link
Owner Author

rom1504 commented Feb 8, 2013

Oh I guess there is no need for an ensure, or maybe just an alias :
ensure <condition> would be repeat if <condition> do <task> done then wait 1000 (I guess a done is needed then...)
Hum, it might be more complicated than that since that task needs to come from somewhere...

@rom1504
Copy link
Owner Author

rom1504 commented Feb 8, 2013

It's better to keep the number of these links (if,repeat,when) small and to use them for many different things I think.

@rom1504
Copy link
Owner Author

rom1504 commented Feb 8, 2013

Examples :

  • when :
    • when entity hurt me do attack nearest reachable mob (attack it would be nicer)

@rom1504
Copy link
Owner Author

rom1504 commented Feb 8, 2013

It would be really nice to be able to know what is the latest 'noun' use in the commands in order to be able to do this kind of thing :

  • move to nearest reachable mob then attack it
  • move to nearest reachable position nearest block log then get it (this one would be harder since there are two potentially useful noun : the nearest reachable position and the nearest block log. This could be resolved by storing both then figuring out which one is the required on with the type of it on get it (a block))

@rom1504
Copy link
Owner Author

rom1504 commented Feb 9, 2013

"whoa, meta programming!" -> didn't thought of it that way before.
But now you thought of it for me (^^) let's use jison :-)

@rom1504
Copy link
Owner Author

rom1504 commented Feb 11, 2013

Lot of things done to make this happen.
There are a lot more things that can be done that way.
Of what we talked here what's left is to do is : ensure, when, it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants