LUA, Bots and coroutines in Vanilla menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Valediction's Avatar Active Member
    Reputation
    37
    Join Date
    Jul 2012
    Posts
    48
    Thanks G/R
    8/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA, Bots and coroutines in Vanilla

    Hi,

    I've been considering coding most stuff in LUA directly lately. I can now register new CFuncs into the lua engine, run chunks (and with that, files) but the problem of yielding comes out, since all code must run in the main thread for obvious reasons.

    A first design could be to invoke some LUA pulse function in the injected pulse function which in turns calls coroutine.resume in some function. That function would in turn call yield whenever it has to wait for some event. I would like to bring up a couple of questions:

    - Has anyone implemented a similar model with success? Or could it be improved in some obvious way?

    - In 1.12, the coroutine part of the lua library seems to be missing. 1.12 uses Lua 5.0 which I can see includes the coroutine library from the documentation. However, Wow's implementation seems to remove it. I can locate the varios LUA library loading functions, but not the coroutine library, neither the corresponding functions. Can anybody confirm if the library is really there, hidden somewhere, or has been striped?

    - Has anyone managed to inject/load a DLL with a regular LUA implementation so that the LUA system can be used more easily (and comprehensively, in case of stripped libraries)? I tried to use Lua 5.0.3 in 1.12 but it kept crashing when passing it WoW's lua_state pointer, probably due to some binary incompatibility. (This despite running in the main thread, of course)

    LUA, Bots and coroutines in Vanilla
  2. #2
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Valediction View Post
    - In 1.12, the coroutine part of the lua library seems to be missing. 1.12 uses Lua 5.0 which I can see includes the coroutine library from the documentation. However, Wow's implementation seems to remove it. I can locate the varios LUA library loading functions, but not the coroutine library, neither the corresponding functions. Can anybody confirm if the library is really there, hidden somewhere, or has been striped?
    Coroutines weren't added until 2.0.1: Patch 2.0.1/API changes - WoWWiki - Your guide to the World of Warcraft
    You can probably take a look at the lua source and see how coroutines are loaded in, and then load that library yourself.

    Originally Posted by Valediction View Post
    - Has anyone managed to inject/load a DLL with a regular LUA implementation so that the LUA system can be used more easily (and comprehensively, in case of stripped libraries)? I tried to use Lua 5.0.3 in 1.12 but it kept crashing when passing it WoW's lua_state pointer, probably due to some binary incompatibility. (This despite running in the main thread, of course)
    WoW has some taint fields in the structures. You would have to add these fields to the lua state. When I did these things, I found the lua*_ functions in WoW and used those, instead of trying to link my own lua runtime.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #3
    Valediction's Avatar Active Member
    Reputation
    37
    Join Date
    Jul 2012
    Posts
    48
    Thanks G/R
    8/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your answer. I just saw it after spending the whole evening trying to see what's going on more closely, and I can tell indeed that WoW is modifying the structure with extra fields, making the whole thing blow up if I try to use the functions from a regular (compiled) lua DLL (a pure 5.0 this time which should match WoW's if it weren't for those extra fields...)

    I'm already comparing on a very low level both WoW's LUA and the standalone LUA. Unfortunately, coroutines belong to LUA's base library, in addition to many other important functions which are present, like getfenv, ipairs, get/setmetatable... but the section for the coroutine library isn't present in the executable (it's not that it doesn't get loaded, it is probably removed from the source) so it probably won't be trivial...

Similar Threads

  1. Mac OS X Bots and Programs ?
    By Flying Piggy in forum World of Warcraft General
    Replies: 0
    Last Post: 02-22-2007, 01:48 PM
  2. Bots And Hacks
    By Bloodpoisen in forum World of Warcraft General
    Replies: 9
    Last Post: 01-24-2007, 01:37 AM
  3. Link to Bots and Whatnots
    By leoj in forum World of Warcraft Bots and Programs
    Replies: 11
    Last Post: 01-13-2007, 10:12 AM
  4. What is a good bot and the chances?
    By joeeb22 in forum World of Warcraft General
    Replies: 3
    Last Post: 12-07-2006, 12:05 PM
  5. Fishing bot and banned.
    By Wraith in forum World of Warcraft General
    Replies: 11
    Last Post: 10-13-2006, 03:17 PM
All times are GMT -5. The time now is 04:49 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search