Casino.mac w/ Stats

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

User avatar
FreQuency
a hill giant
a hill giant
Posts: 215
Joined: Tue Sep 23, 2003 6:03 pm

Casino.mac w/ Stats

Post by FreQuency » Wed Nov 29, 2006 11:28 pm

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
Last edited by FreQuency on Fri Dec 01, 2006 8:41 pm, edited 2 times in total.
Frequency
[quote="Lax"] "And before you whine about how we treat our short bus users..."[/quote]
[quote="skyler"]"I come for the comradery, I stay for the positive atmosphere."[/quote]
[quote="dont_know_at_all"]"i rather you not get VIP so i won't feel bad about banning your ass when you keep asking stupid questions"[/quote]

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Post by dewey2461 » Thu Nov 30, 2006 2:07 am

Wow very cool

mekaniak
a hill giant
a hill giant
Posts: 290
Joined: Thu Sep 18, 2003 3:21 pm

Post by mekaniak » Fri Dec 01, 2006 1:26 pm

an automated way to lose all your platz, woowoo!!!
I love the Power Glove, it's so bad

Say hello to M.C. Smurf!

[quote]<mekaniak> adios guys.
<dont_know_at_all> idiot
* mekaniak is now known as mekaniak_dinner
<Jacensolo> me?
<dont_know_at_all> not this time
[/quote]

[quote]
<dont_know_at_all> A_Enchanter_00, how the fuck should i know? it's your code[/quote]

I love quoting IRC chat.

drpepperman
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Jan 28, 2007 12:44 pm

getting an error

Post by drpepperman » Thu Feb 22, 2007 1:32 am

getting an error of "cannot load file" any ideas ?

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Thu Feb 22, 2007 2:19 am

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 ?
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

eddashmatt

Post by eddashmatt » Fri Apr 27, 2007 3:13 pm

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

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Fri Apr 27, 2007 3:14 pm

This is not a plugin. This is a macro. You do not compile macros.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

eddashmatt

Post by eddashmatt » Fri Apr 27, 2007 3:17 pm

ok sorry I am still very new to MQ2, .. so how do I get this to work

wakkedup
a ghoul
a ghoul
Posts: 114
Joined: Tue Apr 11, 2006 5:25 am

Post by wakkedup » Fri Apr 27, 2007 3:48 pm

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:
Nothing to see here. Move along.

nandyen
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Nov 14, 2008 11:00 pm

Post by nandyen » Fri Nov 14, 2008 11:02 pm

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.
tech