auto eoj standalone. (source / blah)

Talk about anything in Runes of Magic. This does not need to pertain to botting.
Post Reply
Message
Author
AnitsNZ
Posts: 11
Joined: Sun Feb 09, 2014 8:46 pm

auto eoj standalone. (source / blah)

#1 Post by AnitsNZ » Sun Feb 16, 2014 4:54 am

...
Last edited by AnitsNZ on Sun Feb 23, 2014 11:06 pm, edited 1 time in total.

AnitsNZ
Posts: 11
Joined: Sun Feb 09, 2014 8:46 pm

Re: auto eoj standalone. (source / blah)

#2 Post by AnitsNZ » Sun Feb 23, 2014 10:39 pm

well i wasn't even going to update this due to lack of reply even though i know it was downloaded -_-" .... but i am pleased with the turnout and am a firm believer in sharing to expand the horizons of the community public or not. compile it yourself.

http://postimg.org/image/jnw1tg655/ < my version


runs in background (even to minimized window)
runs no matter what npc/player is selected
gives you free eoj in a standalone app. whatever
note that when hack is started you need to have papp selected to get his dynamic number for rest of hack runtime.

Code: Select all


Imports System.Media

Public Class Form1

    Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Integer
  
    Private Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    Private Declare Auto Function PostMessage Lib "USER32.DLL" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean

    Dim totaleoj, earnedeoj, time_elapsed, times_run As Integer
    Dim phase As Boolean = False



    Function endofevent()

        Dim i As Integer = ((ReadLong(&HA02670) - totaleoj) - earnedeoj) '// Calculate EOJ earned in latest event
        times_run += 1
        ListBox1.Items.Add(times_run & "- EOJ=" & i) '// Update Listbox with latest event info
        earnedeoj = ReadLong(&HA02670) - totaleoj '// Set EOJ earned since aEOJ start.
        Timer3.Enabled = False
        time_elapsed = 0 '// Reset timer for next event
        phase = False '// Tell timer1 to realise its not the first event
        Prog1.Value = 0 '// Reset progressbar.
        Timer2.Enabled = False
        '// Timer4.Enabled = False

        If CheckBox2.Checked = True Then '// If hide gui on then hide GUI toggle
            SendKeys.Send("^(z)")
        End If

    End Function

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        If phase = False Then '// hasnt been an event yet

            If times_run = 0 Then

                Select Case Label6.Text '// Animate Calculating
                    Case "Calculating"
                        Label6.Text = "Calculating."
                    Case "Calculating."
                        Label6.Text = "Calculating.."
                    Case "Calculating.."
                        Label6.Text = "Calculating..."
                    Case "Calculating..."
                        Label6.Text = "Calculating"
                End Select

            Else

                Label6.Text -= 1 '// if not first event countown in second increments 
                '// to give best estimate of next event
            End If


            '// If Event Started
            If ReadLongPointer(&H400000 + &H605AC8, &H0, &H0) = 1768383826 Then
                WriteLongPointer(&H9E150C, &H5A8, &H278, Label3.Text) '// set papp hesof as target
                Timer2.Enabled = True '// Toggle event end checker
                Timer3.Enabled = True '// macro send
                ' Timer4.Enabled = True
                Label6.Text = 1200 '// set 20 minutes till next event
                phase = True '// set event to has run atleast once.
                SystemSounds.Beep.Play() '// play nopise to notify enduser of event start

                If CheckBox2.Checked = True Then
                    SendKeys.Send("^(z)") '// if hide gui selected hide gui.
                End If

            End If

        Else

            Label6.Text -= 1

        End If


    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick

        'On Error Resume Next

        Prog1.Value = time_elapsed '// update visuals for enduser
        time_elapsed += 1          '// increment time events been running


        If CheckBox1.Checked = True Then '// if +spam activated run for 2 minutes

            If time_elapsed = 120 Then
                Call endofevent()
            End If

        ElseIf CheckBox4.Checked = True Then '// if -spam activated run for 20 seconds

            If time_elapsed = 20 Then
                Call endofevent()
            End If

        Else

            If time_elapsed = 90 Then '// if standard time mode run for 90 seconds
                Call endofevent()
            End If

        End If

    End Sub

    Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
        '// send keyup keydown to rom window no matter the state
        Dim hwnd As IntPtr = FindWindow(vbNullString, "Runes of Magic")
        PostMessage(hwnd, &H100, &H31, &H1D0001) '//down
        PostMessage(hwnd, &H101, &H31, &H2F0001) '//up
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        gameselect = "Client" '// tell core module what process to work with
        Timer1.Enabled = True '// activate event monitor for start
        totaleoj = ReadLong(&HA02670) '// collect total eoj at start of hack run
        Label3.Text = ReadLongPointer(&H9E150C, &H5A8, &H278) '// grab dynamic value of papp hessof to run
        '// weather he is selected or not (triggers on event start)
    End Sub

    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged

        If CheckBox3.Checked = True Then '// +speed
            Timer3.Interval = 225
        Else
            Timer3.Interval = 400
        End If

    End Sub

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged

        If CheckBox1.Checked = True Then '// +time
            Prog1.Maximum = 120
        Else
            Prog1.Maximum = 90
        End If
    End Sub

    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
        If CheckBox4.Checked = True Then '// -time
            Prog1.Maximum = 20
        Else
            Prog1.Maximum = 90
        End If
    End Sub

    Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick

        '// monitor event end without timer
        If ReadLongPointer(&H400000 + &H605AC8, &H0, &H0) = 543516756 Then
            SystemSounds.Beep.Play()
            Call endofevent()
        End If


    End Sub
End Class


'// update of module with writeprocessmem.

Code: Select all


Module CORE


    Private Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
    Private Declare Function ReadFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByRef buffer As Single, ByVal size As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
    Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
    Private Declare Function WriteProcessMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer

    Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer
    Public RBuff1 As Long
    Public RBuff2 As Single
    Public RBuff3 As Integer
    Public gameselect As String


    Public Function WriteLongPointer(ByVal Base As Integer, _
                                          ByVal Offset0 As Short, _
                                          ByVal Offset1 As Short, _
                                          ByVal Value As Long)
        Dim fullAddress As Long
        Dim Proc As Process() = Process.GetProcessesByName(gameselect)
        If Proc.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, Proc(0).Id)
        '//////////////////////////////////////////////////
        ReadProcessMemory(processHandle, Base, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset0
        '''''''''''''''''''''''''''''''''''''''''''''''''''
        ReadProcessMemory(processHandle, fullAddress, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset1
        '//////////////////////////////////////////////////
        WriteProcessMemory(processHandle, fullAddress, Value, 4, Nothing)
        Return RBuff1
        CloseHandle(processHandle)
    End Function

    'ReadLong
    Public Function ReadLong(ByVal Address As Integer)
        Dim Proc As Process() = Process.GetProcessesByName(gameselect)
        If Proc.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, Proc(0).Id)
        ReadProcessMemory(processHandle, Address, RBuff1, 4, Nothing)
        CloseHandle(processHandle)
        Return RBuff1
    End Function

    'ReadLongPointer
    Public Function ReadLongPointer(ByVal Base As Integer, ByVal Offset0 As Short, ByVal Offset1 As Short)
        Dim fullAddress As Long
        Dim Proc As Process() = Process.GetProcessesByName(gameselect)
        If Proc.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, Proc(0).Id)
        ReadProcessMemory(processHandle, Base, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset0
        ReadProcessMemory(processHandle, fullAddress, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset1
        ReadProcessMemory(processHandle, fullAddress, RBuff1, 4, Nothing)
        Return RBuff1
        CloseHandle(processHandle)
    End Function
   

End Module

if anyone is genuine in using / upgradeing this pm me ill help where i can i think ive commented it pretty well though
time to get back to my corona. cheers =)
Last edited by AnitsNZ on Sun Feb 23, 2014 11:36 pm, edited 2 times in total.

AnitsNZ
Posts: 11
Joined: Sun Feb 09, 2014 8:46 pm

Re: auto eoj standalone. (source / blah)

#3 Post by AnitsNZ » Sun Feb 23, 2014 11:01 pm

if someone was wanting to add extra shit

Code: Select all

'// note you will have to add another offset to the write process mem function (hint c&p 2 lines of code if you are lazy)
function fly()
WriteLongPointer(&H9E150C, &H5A8, &Hf0, &Hb4, 4) '// set playerstate to swimming           
end function

function speed()
WriteLongPointer(&H9E150C, &H5A8, &H40, &H0, 65) '// set playerspeed to 65(running)           
end function
and call them from a timer. speed i havent played with, fly there is the micromacro version where it nops a certain amount of bytes i dunno i think its 10 whatever, another method if you dont want to continuously set playerstate as 4 is to set it as 4 once and then nop the decreaser of playerstate which is 6 bytes i belive i dunno i dont remember it makes fuck all difference i just find that method easier for me to find. works anyway and takes less than a minute to find playerstate addy and decreaser.. little longer to find the pointer.



to find unknown quest id's
you need a textbox and a button and an empty quest log.

in game select quest you want to know the id of

then add this to a button

Code: Select all

textbox1.text = ReadLong(&H9FBEF8)
its that easy

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: auto eoj standalone. (source / blah)

#4 Post by Ego95 » Mon Feb 24, 2014 2:31 pm

But can you tell me what's different to a micromacro-script, which does the energys?

AnitsNZ
Posts: 11
Joined: Sun Feb 09, 2014 8:46 pm

Re: auto eoj standalone. (source / blah)

#5 Post by AnitsNZ » Mon Feb 24, 2014 5:23 pm

well the language for one..

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: auto eoj standalone. (source / blah)

#6 Post by beanybabe » Thu Nov 13, 2014 10:46 am

An explanation of how to use it and what to use it for might be handy. Im guessing its to read out timer message. I have no clue why you coded what you did.

Edz
Posts: 10
Joined: Wed Oct 22, 2014 10:44 am

Re: auto eoj standalone. (source / blah)

#7 Post by Edz » Tue Jan 27, 2015 8:57 am

Looks really interest but what does it do??

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests