Page 1 of 1

Casino.mac w/ Stats

Posted: Wed Nov 29, 2006 11:28 pm
by FreQuency
Before running:
All bags must be open and not over lapping.
You must select the casino dealer you wish to deal with.
After Macro has completed you will recieve a stat report of the following:
**Edit Corrected a stat problem
**Edit #2 Corrected gold ticket problem

Image

Code: Select all

|    Casino.mac
|    By: Frequency
|    All bags must be Open
|    Casino Merchant you wish to deal with must be targeted
|

#event NoWin "#*#Lady Luck is not on your side today.#*#"
#event SmallWin "#*#here is your small prize.#*#"
#event MediumWin "#*#Not a bad hand for you#*#"
#event PrettyGoodWin "#*#That is a pretty good hand#*#"
#event GoodWin "#*#That is a good hand!#*#"
#event IllusionWin "#*#mask your appearance#*#"
#event TokenWin "#*#here are your#*#King's Court tokens.#*#"

Sub main
    /declare NoWin int outer
    /declare SmallWin int outer
    /declare MediumWin int outer
    /declare PrettyGoodWin int outer
    /declare GoodWin int outer
    /declare IllusionWin int outer
    /declare TokenWin int outer
    /declare StartTokens int outer
        /varset StartTokens ${FindItemCount[=King's Court Token]}
    
    /declare CasinoNPC int local
        /varset CasinoNPC ${Target.ID}
        /if ( !${CasinoNPC} ) {
            /echo You need to target an NPC you wish to run the casino with
            /endmacro
        }
    /declare TradeSlot int local
        /varset TradeSlot 0
    /declare TurnInsRemaining int local
        /varset TurnInsRemaining 0

:MainLoop    
    /if ( ${FindItemCount[=King's Court Token]} == 0 ) /goto :Done
    /if ( ${FindItemCount[=Gold Ticket]} > 0 ) /goto :Done
    /if ( !${Me.FreeInventory} ) /goto :Done
    
    /if ( ${FindItemCount[=King's Court Token]} > 4 ) {
        /varset TurnInsRemaining 3
    } else {
        /varset TurnInsRemaining ${Math.Calc[${FindItemCount[=King's Court Token]} - 1]}
    }    
    /for TradeSlot 0 to ${TurnInsRemaining}
        /call ClearCursor
        /call GetToken
        /if ( !${TradeSlot} ) {
            /target ID ${CasinoNPC}
            /click Left Target
            /delay 2        
        :WaitForWindow
            /if ( !${Window[GiveWnd].Open} ) /goto :WaitForWindow
        } else {
            /target ID ${CasinoNPC}
            /click Left Target
            /delay 2        
        }            
    /next TradeSlot
    /notify GiveWnd GVW_Give_Button leftmouseup
        /delay 5
        /doevents
    /call ClearCursor
    /goto :MainLoop
:Done
    /call Report
    /call BeepLoop
/return

Sub GetToken
    /ctrlkey    /itemnotify ${FindItem[=King's Court Token].InvSlot} leftmouseup
    /delay 10
    /if ( ( ${Cursor.ID} ) && ( ${Cursor.Name.NotEqual[King's Court Token]} ) ) {
        /call ClearCursor
        /call GetToken
    }
/return

Sub ClearCursor
    /if ( ${Cursor.ID} ) {
    :ClearLoop
        /autoinv
        /delay 1
        /if ( ${Cursor.ID} ) /goto :ClearLoop
    }
/return

Sub BeepLoop
:BeepLoop
    /beep
    /delay 5
    /beep
    /delay 4
    /beep
    /delay 3
    /beep
    /delay 2    
    /beep
    /delay 1
    /goto :BeepLoop
    }
/return

Sub Report
    /doevents
    /declare TotalPlays int local
        /varset TotalPlays ${Math.Calc[${SmallWin} + ${MediumWin} + ${PrettyGoodWin} + ${GoodWin} + ${IllusionWin} + ${TokenWin} + ${NoWin}]}
    /declare TotalWins int local
        /varset TotalWins ${Math.Calc[${SmallWin} + ${MediumWin} + ${PrettyGoodWin} + ${GoodWin} + ${IllusionWin} + ${TokenWin}]}
        
    /echo Total Plays: ${TotalPlays}
    /echo Wins: ${TotalWins}
    /echo Win Percentage: ${Math.Calc[(${TotalWins} / ${TotalPlays}) * 100]}%
    /echo Small Wins: ${SmallWin} - ${Math.Calc[(${SmallWin} / ${TotalPlays}) * 100]}%
    /echo Medium Wins: ${MediumWin} - ${Math.Calc[(${MediumWin} / ${TotalPlays}) * 100]}%
    /echo Pretty Good Wins: ${PrettyGoodWin} - ${Math.Calc[(${PrettyGoodWin} / ${TotalPlays}) * 100]}%
    /echo Good Wins: ${GoodWin} - ${Math.Calc[(${GoodWin} / ${TotalPlays}) * 100]}%
    /echo Illusion Wins: ${IllusionWin} - ${Math.Calc[(${IllusionWin} / ${TotalPlays}) * 100]}%
    /echo Tokens Wins: ${TokenWin} - ${Math.Calc[(${TokenWin} / ${TotalPlays}) * 100]}%
    /echo Tokens Won: ${Math.Calc[${TotalPlays} - ${StartTokens}]}
    /echo Total Time Running: ${Math.Calc[${Macro.RunTime} / 60]} Minutes
/return

Sub Event_NoWin
    /varcalc NoWin ${NoWin} + 1
/return

Sub Event_SmallWin
    /varcalc SmallWin ${SmallWin} + 1
/return

Sub Event_MediumWin
    /varcalc MediumWin ${MediumWin} + 1
/return

Sub Event_PrettyGoodWin
    /varcalc PrettyGoodWin ${PrettyGoodWin} + 1
/return

Sub Event_GoodWin
    /varcalc GoodWin ${GoodWin} + 1
/return

Sub Event_IllusionWin
    /varcalc IllusionWin ${IllusionWin} + 1
/return

Sub Event_TokenWin
    /varcalc TokenWin ${TokenWin} + 1
/return

Posted: Thu Nov 30, 2006 2:07 am
by dewey2461
Wow very cool

Posted: Fri Dec 01, 2006 1:26 pm
by mekaniak
an automated way to lose all your platz, woowoo!!!

getting an error

Posted: Thu Feb 22, 2007 1:32 am
by drpepperman
getting an error of "cannot load file" any ideas ?

Posted: Thu Feb 22, 2007 2:19 am
by Fuergrissa
there is nothing to load from within the macro, you must be entering the name of the mac wrong, when you go to the doctor and he/she says whats wrong, are you one of those people that sits there and says "something" and waits for the diagnosis ?

A little more info is needed, exactly what is the error message, exactly what are you typing prior to the error, have you loaded MQ2 ?

Posted: Fri Apr 27, 2007 3:13 pm
by eddashmatt
this is what I get when i compile the file


Compiling...
MQ2Casino.cpp
C:\testcasino\MQ2Casino\MQ2Casino.cpp(1) : error C2143: syntax error : missing ';' before '|'
C:\testcasino\MQ2Casino\MQ2Casino.cpp(3) : error C2143: syntax error : missing ';' before '|'
C:\testcasino\MQ2Casino\MQ2Casino.cpp(3) : error C2501: 'Frequency' : missing storage-class or type specifiers
C:\testcasino\MQ2Casino\MQ2Casino.cpp(3) : error C2143: syntax error : missing ';' before '|'
C:\testcasino\MQ2Casino\MQ2Casino.cpp(7) : fatal error C1021: invalid preprocessor command 'event'
Error executing cl.exe.

MQ2Casino.dll - 5 error(s), 0 warning(s

Posted: Fri Apr 27, 2007 3:14 pm
by fearless
This is not a plugin. This is a macro. You do not compile macros.

Posted: Fri Apr 27, 2007 3:17 pm
by eddashmatt
ok sorry I am still very new to MQ2, .. so how do I get this to work

Posted: Fri Apr 27, 2007 3:48 pm
by wakkedup
You do more research on how to run a macro, then, when you can't find the information, you post questions on how to run them.

Basically, you'll find the information if you gave it a little bit of effort(maybe look in a wiki or FAQ), so you won't be posting stupid questions that should never have been asked to begin with.

Cheers

:edit: From the Wiki, using MQ2:::>
Macros

You can load a macro with the following command:

Posted: Fri Nov 14, 2008 11:02 pm
by nandyen
How do I change the turn in to 1 per trade?

For some reason I hand in four at once (unstacked) and other than that it works wonderfully.