Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.33k stars 911 forks source link

Changing UserHandlers #190

Closed ghost closed 11 years ago

ghost commented 11 years ago

Is it possible to create a master user handler that branches off to call up other UserHandlers when told to? For example, I want to create a multipurpose bot that is capable of different sorts of banking (key, hat, upgrade, expander etc...). Would it be possible for me to make the bot automatically switch handler depending on what the customer needs? So they could say in chat "Upgrade Bank" and it would load everything from the UpgradeUserHandler?

teliosdev commented 11 years ago

Yup.

waylaidwanderer commented 11 years ago

Not very helpful, @redjazz96 :P

ghost commented 11 years ago

So it's possible then. What would be the best way of achieving this, I'd like to have it so that it switches the handlers as a result of a chat message, but what code would I need?

teliosdev commented 11 years ago

Instead of changing the handlers, I'd have a main handler that proxies the calls to another handler, which you can then change.

ghost commented 11 years ago

How would I do that? :P