Call me crazy

You may request or share scripts for MicroMacro in this forum.
Post Reply
Message
Author
zuel
Posts: 21
Joined: Mon Jan 10, 2011 12:49 am

Call me crazy

#1 Post by zuel » Thu Jan 20, 2011 4:09 am

Since I've been stuck on my bot I've been toying with different ideas for a lua graphical interface.

The thought struck me, HTTP. My ideal scenario would be to have lua open a listening socket on port xxx and provide content dynamically served like the old days but using technologies like HTTP push to create a more responsive GUI.

I looked at the network API provided by MicroMacro but I didn't see the ability to specify the port and it also required a key for some reason. I didn't spend enough time in libnet code to identify if the key can be passed as null however since I was thrown by not specify a port.

Why you ask would I use an html file when there are already kits for lua to provide a gui one may ask?

Well I am struggling to keep the code self contained within what MicroMacro already supports. Any other requirements outside of what has been compiled into micromacro simply means more confusion for the end-user.

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Call me crazy

#2 Post by Administrator » Thu Jan 20, 2011 7:07 am

zuel wrote: The thought struck me, HTTP. My ideal scenario would be to have lua open a listening socket on port xxx and provide content dynamically served like the old days but using technologies like HTTP push to create a more responsive GUI.
I've actually considered this, myself. There's already dozens of related projects on LuaForge. All you would have to do is download the binary package for one of these, drop the main DLL into the plugins directory and the rest of them (if there are any) will remain in the base micromacro directory. That's it. You can start using functions from that plugin.
I looked at the network API provided by MicroMacro but I didn't see the ability to specify the port and it also required a key for some reason. I didn't spend enough time in libnet code to identify if the key can be passed as null however since I was thrown by not specify a port.
Those functions aren't very well suited for doing a web server. First, I'm pretty sure the messages are sent as UDP, not TCP. And, all information is encrypted. It's really only designed to communicate with other copies of MicroMacro across your network or internet.

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: Call me crazy

#3 Post by 3cmSailorfuku » Thu Jan 20, 2011 1:34 pm

You will just do fine with CURL, updating in ticks/heartbeats your information as they are requested or not. I had a frontend myself for the runes of magic bot, which I discarded later because I stopped playing the game and then becomming useless as it wasn't a module but little fixes to transmit the data to a webserver and then processing it.

But yes, it's quite possible.

zuel
Posts: 21
Joined: Mon Jan 10, 2011 12:49 am

Re: Call me crazy

#4 Post by zuel » Fri Jan 21, 2011 1:13 am

well one of the things I am trying to avoid is adding stuff. I think there is a bit of disconnect in distributing of MicroMacro scripts.

When/If I add a script/project or distributable, if I have different resources and such, the user needs to understand the MicroMacro directory structure.

I think it would be more beneficial if under the scripts directory, a script resided in it's very own directory. Underneath this would be a similar directory structure to MicroMacro that includes Commands, Data, Lib.. etc.. such that it was a comprehensive repository of everything related to that script.

This simplifies install. Unzip this file into MicroMacro\scripts.

It's a great product for sure and I love all the work that has been done on it.

Well getting back to the topic. I am not sure what curl does, luacurl seems to be a browser for lua. I am looking to create an appserver/cgi for lua. That in it's simplest form simply allows lua to present form data and accept a form submit. Parse the form elements and update the program accordingly. In the more complicated scenerio, use lua to take a screen capture at different intervals and use HTTP PUSH technology to create a streaming video of your bot's progress.

Though I am looking to the middle ground. and update in real-time to a web page displaying bot statistics. I mean, how cool would it be to access your bot from your smartphone to see it's progress? (without javascript to refresh the page or a manual refresh)

We are talking simple web pages here and for the most part, basic form data. Text boxes, check boxes etc.. So, if MicroMacro opened the listening port. Accepted a LUA table structure with a set of pages, each page a sub table with name value pairs. The html could be stored in an HTML working directory. All MicroMacro would need to do is match html page to the lua table page, parse the html VIA regular expression to populate the value tags in the html. On form submit, perform the same in reverse order.

god I wish I was up on my c++ more. I unfortunately use one of those useless Microsoft compilers! *wink* - Administrator. Though, I admit, anything post 5.2 Microsoft developer, is really bad for c/c++. My world is now in c# and I love it.

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Call me crazy

#5 Post by MiesterMan » Wed May 18, 2011 3:28 pm

I can appreciate your idea. But I think you're making this way too complicated. It almost sounds like you want to make MicroMacro a webserver or rather something the sends a lot of data to a webserver hosting your website so you can see the data on that site.

I'll make this short. First, using a seperate web server to post your data is silly. If you're going to send the data from your botting machine you may as well just host the page from your botting machine. So we'll establish this: You will be hosting the page on your botting machine.

Since you're hosting your page on your botting machine everything is simple. Use micromacro to update the xml form storing your data in your published directory and have a page that displays it that updates the data from the xml form live (I think every 5 seconds would be more than enough).

I actually like this idea a lot since it removes that need to remote control your botting machine to see what's happening in the middle of the day (or submission to the idea that you'll just see how it is when you get home).

Suggestion: I don't see a need to alter MicroMacro for this. Creating a script based addon would be sufficient.

Note: I realized near the end of my post this was a necro but as I like the idea I'm posting anyways. :)

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: Call me crazy

#6 Post by 3cmSailorfuku » Wed May 25, 2011 9:07 am

zuel wrote:Well getting back to the topic. I am not sure what curl does, luacurl seems to be a browser for lua. I am looking to create an appserver/cgi for lua. That in it's simplest form simply allows lua to present form data and accept a form submit.
I'm going to call you crazy for this.

Why do something with 10000 lines when you can achieve the same in one line with a curl function that effectively works better and in the same way of what you want to accomplish?

If you're unsure on what CURL does by glance then you are probably not experienced in HTTP transmissions. Going as far as saying to even make a server on that protocoll that CURL can already easily do is very crazy.

JSON, CGI/PHP, CURL can do everything you wanted.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests