Sign in to follow this  
Followers 0
rschanke

Making a macro like this communicate with another computer

4 posts in this topic

Hello guys. I wrote this macro for a game, and its designed to be run alongside an extremely similar macro on another computer. The issue is that it is dependant on being synced with one another, and over time they dont work with each other as they should, and it needs to be manually restarted. Would it be possible for one of the very talented people on this forum to rewrite this or direct me towards a tutorial on how it might be done, so that two computers will communicate, making the "While" part of the macro always start at the same time on both the computers?

CONST $rest = "175000"

CONST $wand2 = "2"

CONST $wand3 = "3"

CONST $wand4 = "4"

CONST $wand5 = "5"

CONST $wand6 = "6"

CONST $TotalUsePerWand = 528

$CurrentWandKey = $wand2

MsgBox( 0, "Alert", "Click OK" )

WinWaitActive( "Darkfall Online" )

Sleep ( 2000 )

$WandUses = 0

While $WandUses <= $TotalUsePerWand

Sleep ( 500 )

Call ( "EquipWeapon" )

Call ( "Parry" )

Sleep ( 2000 )

Call ( "Attack" )

Call ( "Attack" )

Call ( "Attack" )

Call ( "EquipWeapon" )

Call ( "Rest" )

$WandUses = $WandUses+24

If($WandUses = $TotalUsePerWand) Then

ChangeWand()

EndIf

WEnd

Func ChangeWand()

Sleep(500)

Select

Case $CurrentWandKey = $wand2

$CurrentWandKey = $wand3

Case $CurrentWandKey = $wand3

$CurrentWandKey = $wand4

Case $CurrentWandKey = $wand4

$CurrentWandKey = $wand5

Case $CurrentWandKey = $wand5

$CurrentWandKey = $wand6

EndSelect

$WandUses = 0

Sleep(500)

Send($CurrentWandKey)

Sleep(500)

EndFunc

Func EquipWeapon()

Sleep ( 2000 )

Send ( "R" )

Sleep ( 2000 )

EndFunc

Func Attack()

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

Sleep ( 1300 )

MouseClick ( "Left" )

EndFunc

Func Parry()

Send ( "{V DOWN}" )

Sleep ( 31200 )

Send ( "{V UP}" )

EndFunc

Func Rest()

Sleep ( 1000 )

Send ("0")

Sleep ( 1000 )

MouseClick ( "Left" )

Sleep ( 500 )

Send ("0")

Sleep ( 500 )

MouseClick ( "Left" )

Sleep ( 500 )

Send ("0")

Sleep ( 500 )

MouseClick ( "Left" )

Sleep ( $rest )

Send ("W")

Sleep ( 3000 )

EndFunc

Share this post


Link to post
Share on other sites



TCPSend/TCPRecv on both scripts?

Share this post


Link to post
Share on other sites

TCPSend/TCPRecv on both scripts?

I wouldnt know how to do that, i'm not that proficient with auto it. I can write scripts like this, but I am still a newbie. Could you elaborate or direct me towards a guide of some kind?

Share this post


Link to post
Share on other sites

There are plenty of examples in the help file, so you can at least have a look.

Here is an example how your both script header should or could look like:

Server:

TCPStartup()

Dim $sSocket, $sAccSocket
Dim $fFail = False

$sSocket = TCPListen(@IPAddress1, 32123)

If $sSocket <> -1 Then
    MsgBox(0x40, 'Server socket', $sSocket)
    Do
        $sAccSocket = TCPAccept($sSocket)
    Until $sAccSocket <> -1
    TCPCloseSocket($sSocket)
Else
    $fFail = True
    MsgBox(0x10, 'Server error', 'Could not create socket')
EndIf

TCPShutdown()
If $fFail Then Exit MsgBox(0x10, 'Server error', 'Will give up now')oÝ÷ Ø)bz{ZºÚ"µÍÔÝ

B[H ÌÍÜÔÛØÚÙ][H ÌÍÙZ[H[ÙBÌÍÜÔÛØÚÙ]HÔÛÛXÝ
    ÌÍÜÒTYÌLÊBÙÐÞ

    ÌÎNÐÛY[ÛØÚÙ]    ÌÎNË ÌÍÜÔÛØÚÙ]
BY  ÌÍÜÔÛØÚÙ]   ÉÝÈLH[SÙÐÞ

    ÌÎNÐÛY[ ÌÎNË ÌÎNÔÝXØÙÜÙ[HÛÛXÝYÈHÙÌÎNÊBUÔÛÜÙTÛØÚÙ]
    ÌÍÜÔÛØÚÙ]
B[ÙBIÌÍÙZ[HYBSÙÐÞ
L   ÌÎNÐÛY[ ÌÎNË ÌÎNÐÛÝ[ÝÛÛXÝÈHÙÌÎNÊB[YÔÚ]ÝÛ
BY  ÌÍÙZ[[^]ÙÐÞ
L   ÌÎNÐÛY[ÜÌÎNË    ÌÎNÕÚ[Ú]HÝÉÌÎNÊ

So both should start at the ~same time or fail and not continue to the main script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0