***last itm i write a macro at 2:30am revisions are buggy will fix them tomorrow
**original post had a logic flaw fixed untested though
Usage /macro casino
MUST have NPC you wish to trade with in range and targeted
Code: Select all
#event small_Prize "here is your small prize."
#event no_Win "Lady Luck is not on your side today."
#event medium_Win "Not a bad hand for you"
#event illusion_Win "mask your appearance"
#event good_Win "That is a good hand!"
#event pretty_Good "That is a pretty good hand"
Sub Main
/declare lose global
/declare smallPrize global
/declare mediumPrize global
/declare good global
/declare prettyGood global
/declare illusion global
/declare unknowns global
/declare tokensGiven local
/declare TradeSlot local
/declare tokensWon global
/declare CasinoNPC local
/declare turnInsLeft local
/declare delay local
/varset lose 0
/varset smallPrize 0
/varset mediumPrize 0
/varset good 0
/varset prettyGood 0
/varset illusion 0
/varset tokensGiven 0
/varset TradeSlot 0
/varset unknowns 0
/varset tokensWon 0
/varset CasinoNPC "$target(id)
/varset turnInsLeft 0
/varset delay 2
/if @CasinoNPC=="NULL" {
/echo You need to target an NPC you wish to run the casino with
/endmacro
}
:Loop
/if n $count("King's Court Token")==0 /goto :Done
/if n $count("King's Court Token")>=4 /varset turnInsLeft 3
/if n $count("King's Court Token")<4 /varset turnInsLeft $calc($count("King's Court Token")-1)
/sendkey down ctrl
/for TradeSlot 0 to @turnInsLeft
:GetToken
/sendkey down ctrl
/if n $count("Gold Ticket")>0 /goto :Done
/varadd tokensGiven 1
/finditem "King's Court Token"
/delay 1
/if "$cursor(name)"!="King's Court Token" /goto :GetToken
/sendkey up ctrl
/if n @TradeSlot!=0 /click left npctrade @TradeSlot
/delay @delay
/target id @CasinoNPC
/if n @TradeSlot==0 /click left target
/delay @delay
/next TradeSlot
/click left npctrade give
/delay @delay
/doevents
:clearCursor
/if "$cursor(name)"=="King's Court Token" /varcalc tokensWon @tokensWon+$cursor(stack)
/autoinv
/delay @delay
/if $cursor()!="NULL" /goto :clearCursor
/goto :Loop
:Done
/call Log "Tokens Played: $int(@tokensGiven)"
/call Log "Wins: $int($calc(@tokensGiven-@lose))"
/call Log "Small Stat Food: $int(@smallPrize)"
/call Log "Medium Stat Food: $int(@mediumPrize)"
/call Log "Gem: $int(@prettyGood)"
/call Log "Large Item $int(@good)"
/call Log "Illusion Potions: $int(@illusion)"
/call Log "Tokens Won: $int(@tokensWon)"
:BeepLooP
/beep
/goto :BeepLoop
/return
Sub Event_no_Win
/varadd lose 1
/return
Sub Event_illusion_Win
/varadd illusion 1
/return
Sub Event_small_Prize
/varadd smallPrize 1
/return
Sub Event_medium_Prize
/varadd mediumPrize 1
/return
Sub Event_good_Win
/varadd good 1
/return
Sub Event_pretty_Good
/varadd prettyGood 1
/return
Sub Log
/mqlog "@Param0"
/echo "@Param0"
/return
