please tell me how to do hello world

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

please tell me how to do hello world

Postby Torero » Sun Apr 27, 2008 9:13 am

I really want to learn LSS, so is it ok if I bug you guys a lot?

To start, how do I do hello world?

LSS interface sure is different.
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Postby mezzo » Sun Apr 27, 2008 9:40 am

Code: Select all
void print_hello_world() {
PrintF("Hello World.");
}

void on_hk_1() {
print_hello_world();
}


then bind hk 1 to a hotkey... voila, 1 hello world.
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby Torero » Sun Apr 27, 2008 9:42 am

where is main?

how do I bind it to a hotkey?
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Postby mezzo » Sun Apr 27, 2008 9:47 am

there is no main.

* ctrl+k for the hotkey menu (or just look under tools)
* click new
* select the key you want to bind it to
* change the option 'funtion' to "scriptfunction'
* in parm 1 box, add the number of the hotkey (so for on_hk_1 put 1 in that box)

and that's it..

(I think the reason there is no main, is cuz the main is internal to LSS and MHS and that main is a routine that polls for hotkeys.)
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby Torero » Sun Apr 27, 2008 9:50 am

there is no main ...
man this is wacked :lol:
this is so new a concept i am like

this is what I am needing to write, is that achievable in LSS?

I need to write a very smart bot for this mmorpg I am playing,
if there is no main, how does it respond to events and do things I want it to do?
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Postby Torero » Sun Apr 27, 2008 9:55 am

or should I write a function to be called by a hotkey that will act as my main?
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Postby mezzo » Sun Apr 27, 2008 10:04 am

Yes, write a function that acts as your main and bind that to a hotkey.
Or you can also make a little frontend in LSS, so that you can press a button to start you hack.

if you have access to private, check out my hfff bot script version 1.4
it should give you a good idea of what and how.

if you don't have access, check the snippet below:

Code: Select all
VOID ShowDialog() {
    // Create a dialog.
    HWND hDialog = CreateDialog(
        NULL,               // No owner.
        "my bot (c)",         // Window title.
        90, 120, 320, 300,   // Position and size.
        "" );               // No function for handling messages this time.

    if ( hDialog == NULL ) { return; }


    // Enumerate the control ID’s. 0 is not a valid control ID, so start at 1.
    enum {
        CTRL_BUTTON_HERO = 1,
        CTRL_BUTTON_SKILL,
        CTRL_BUTTON_FLAGS1,
        CTRL_BUTTON_FLAGS2,
        CTRL_BUTTON_MMAP,
        CTRL_BUTTON_CLOSE,
        CTRL_BUTTON_DEMO,
        CTRL_BUTTON_SHOWF,
        CTRL_BUTTON_ONCE,
        CTRL_BUTTON_REPEAT,
        CTRL_BUTTON_FULL,
        CTRL_BUTTON_GO,
        CTRL_CHECK,
        CTRL_CHECK_TEST,
        CTRL_CHECK_DEBUG,
        CTRL_CHECK_CUSTOMER,
        CTRL_EDIT,
       
    };

    // Add a button to it.
    if ( !AddButton( hDialog,
        20, 10, 75, 23,
        CTRL_BUTTON_HERO, "Select HeroS",
        "HeroButtonProc" ) ) { return; }

     // Add a button to it.
    if ( !AddButton( hDialog,
        20, 35, 75, 23,
        CTRL_BUTTON_SKILL, "Select skills",
        "SkillButtonProc" ) ) { return; }
     
    // Add a button to it.
    if ( !AddButton( hDialog,
        20, 60, 75, 23,
        CTRL_BUTTON_FLAGS1, "Flags 1",
        "Flags1ButtonProc" ) ) { return; }
       
    // Add a button to it.
    if ( !AddButton( hDialog,
        20, 85, 75, 23,
        CTRL_BUTTON_FLAGS2, "Flags 2",
        "Flags2ButtonProc" ) ) { return; }
       
    // Add a button to it.
    if ( !AddButton( hDialog,
        20, 115, 75, 23,
        CTRL_BUTTON_MMAP, "MissionMap",
        "MissionButtonProc" ) ) { return; }

   // Add a button to it.
   // Our function to handle the Close button.
    if ( !AddButton( hDialog,
        20, 230, 75, 23,
        CTRL_BUTTON_CLOSE, "Close",
        "CLOSEButtonProc" ) ) { return; }
       
   // Add a button to it.
    if ( !AddButton( hDialog,
        110, 10, 75, 23,
        CTRL_BUTTON_DEMO, "+demo",
        "DEMOButtonProc" ) ) { return; }

   // Add a button to it.
    if ( !AddButton( hDialog,
        110, 35, 75, 23,
        CTRL_BUTTON_SHOWF, "+ShowF",
        "ShowFactionButtonProc" ) ) { return; }
   
   // Add a button to it.
   if ( !AddButton( hDialog,
        110, 75, 75, 23,
        CTRL_BUTTON_ONCE, "+Once",
        "DISCOVERButtonProc" ) ) { return; }       

   // Add a button to it.
   if ( !AddButton( hDialog,
        110, 105, 75, 23,
        CTRL_BUTTON_REPEAT, "+Repeat",
        "MARKButtonProc" ) ) { return; }       

   // Add a button to it.
   if ( !AddButton( hDialog,
        110, 135, 75, 23,
        CTRL_BUTTON_FULL, "+FullF",
        "VIEW_MARKButtonProc" ) ) { return; }               


    // Add a check to it.
    if ( !AddCheck( hDialog,
        195, 10, 75, 16,
        CTRL_CHECK_TEST, "Test",
        "TestProc" ) ) { return; }

    // Add a check to it.
    if ( !AddCheck( hDialog,
        195, 30, 75, 16,
        CTRL_CHECK_DEBUG, "Debug",
        "DebugProc" ) ) { return; }
       
    // Add a check to it.
    if ( !AddCheck( hDialog,
        195, 51, 75, 16,
        CTRL_CHECK_CUSTOMER, "Customer",
        "CustomerProc" ) ) { return; }

   // Add a button to it.
   if ( !AddButton( hDialog,
        195, 75, 75, 23,
        CTRL_BUTTON_GO, "+Go",
        "for_real" ) ) { return; }               
     
    if ( !AddStatic( hDialog,
      200, 115, 75, 13,
      0, "Mezzo b0t v1.3 (c)" ) ) { return; }

//
// Trying to get all the handles into the global variables, instead of local to a function.
//
botcontrolpanelWND = hDialog;
}
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby shinnsohai » Sun Apr 27, 2008 1:38 pm

:o wah is complicated i want learn too mezzo can tell me some information about it? for newbie like me what should i start?
-šнιηηšσнαι-
User avatar
shinnsohai
n00b
 
Posts: 973
Joined: Mon Feb 18, 2008 7:31 pm
Location: l_ A /\/ G l< A \/\/ I

Postby mezzo » Sun Apr 27, 2008 5:21 pm

the MHS helpfile, which can be downloaded from the same pace as MHS,
contains loads of nice snippets to learn from.
Try them ALL out. (in the helpfile, under scripting - writing scripts - snippets)

and no the above is not difficult, it's just a bunch of win32 calls to make a small frontend with some buttons on it, to be used as frontend for your hacks.
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby L. Spiro » Sun Apr 27, 2008 8:36 pm

Torero wrote:I need to write a very smart bot for this mmorpg I am playing,
if there is no main, how does it respond to events and do things I want it to do?

The level of the bot you can write is limited only to your ability to produce.

Aside from what has already been said, there is another way to make a bot respond to events in your game (event-driven code): breakpoint handlers. These have the advantage of stopping the game while executing also, and are called immediately when the even is triggered.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby Torero » Mon Apr 28, 2008 11:32 am

Do you mean that breakpoints handler have a option of stopping the game or that they have to stop the game?

What is breakpoint in memory hacking context?
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Postby L. Spiro » Mon Apr 28, 2008 2:00 pm

The nature of breakpoints is that they always stop the game. Windows does this itself.
But that does not mean the stop is for a long period. It may be less than half a millisecond and you can not see it in the game (no jitter).

So this is the ideal way to create event-driven script interfaces for your game.

You can even code the adding of breakpoints so that when the game is loaded the breakpoints are automatically added at the right spots. You can do the entire set-up from scripts.

You can also add and remove Hotkeys from scripts, again giving you the ability to do the set-up from code.



In memory-hacking context breakpoints are just a way of pausing the game when certain code is executed so that you can run your own code (and then resume the game code).
It is the same as injecting code but non-intrusive if using hardware breakpoints.
It is not as fast, but still fast enough to do a lot before you notice any jitter in the framerate of your game.
The pause can also happen when certain data is read, written, or either.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby Torero » Mon May 12, 2008 2:36 am

mezzo wrote:there is no main.

* ctrl+k for the hotkey menu (or just look under tools)
* click new
* select the key you want to bind it to
* change the option 'funtion' to "scriptfunction'
* in parm 1 box, add the number of the hotkey (so for on_hk_1 put 1 in that box)

and that's it..

(I think the reason there is no main, is cuz the main is internal to LSS and MHS and that main is a routine that polls for hotkeys.)



parm1 now reads: 0x1


I click compile but nothign happens.
this is in the edit area:

void print_hello_world() {
PrintF("Hello World.");
}

void on_hk_1() {
print_hello_world();
}


I did only two things, setting the hotkey like you said and clicking compile

I think i am missing something; also, since nothing happens when i click compile, I have no idea if the code is running or not.
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Postby mezzo » Mon May 12, 2008 9:31 am

You need to select 'add script' from the file menu (of the script editor).
Then do the compile again. It won't compile or run if you haven't added it.

(once you have select the add funtion from the menu, push F5 for compile again and it should say "succes" in the lower script editor area.
Then you can use the hotkey you have configured.)

let me know if it doesn't work.
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby Torero » Mon May 12, 2008 9:46 am

compile returns success, but when I press h key on the keyboard nothing happens.

does it print into the same window of "success"?
Torero
NULL
 
Posts: 191
Joined: Thu Jan 04, 2007 10:14 am

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests