Bank.mac -- Banking Macro (modified Deposit.mac orig by GD)

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Bank.mac -- Banking Macro (modified Deposit.mac orig by GD)

Post by Amadeus » Sun Jul 21, 2002 2:12 am

Edit: Code modified to use two techniques for withdrawing platinum

Code: Select all

| Banking Macro - Originally Written by GD 
|                 Modified by Amadeus (Withdrawl function)
| 
| Will deposit all coins and then convert it to the highest denomination.  
| If an argument is given, it will withdrawl that many pp after the deposit.  
|
| This macro uses two techniques for withdrawing money.  The first technique
| is faster, but will only work for withdrawls of less than 2001pp.  The second
| method will take a bit more time, but will work for withdrawls of more than 2000pp.
| 
|
| NOTES
|    *   You MUST open your bank before running this macro!
|    *   Altering this macro to use method 1 for withdrawls of more than
|        2000pp is HIGHLY inadvisable.  You will spam yourself offline.
|    *   /endmacro should work perfectly if you get tired of waiting....
| 
| Syntax:   /macro Bank.mac          (Will deposit all your money in the bank)
|           /macro Bank.mac 200      (Will deposit all your money, and then withdraw 
|                                     200pp)
|           /macro Bank.mac 200 nd   (Will withdraw 200pp without depositing money)
| 
#turbo 
#define Amount v50 


Sub Main 
   /varcalc Amount $char(plat)+$char(gold)/10+$char(silver)/100+$char(copper)/1000 
   /varcalc v1 $p0
   /varcalc v2 $p0-1
   /varcalc v3 $char(plat,bank) - $p0
   /sendkey down shift 

   /if $p1~~"nd" /goto :Withdrawl

   :Plat 
      /if n $char(plat)==0 /goto :Gold 
      /click left plat 
      /click left bank plat 

   :Gold 
      /if n $char(gold)==0 /goto :Silver 
      /click left gold 
      /click left bank gold 

   :Silver 
      /if n $char(silver)==0 /goto :Copper 
      /click left silver 
      /click left bank silver 

   :Copper 
      /if n $char(copper)==0 /goto :ConvertCP 
      /click left copper 
      /click left bank copper 

   :ConvertCP 
      /if n $char(copper,bank)==0 /goto :ConvertSP 
      /click left bank copper 
      /click left bank silver 
      /click left bank copper 

   :ConvertSP 
      /if n $char(silver,bank)==0 /goto :ConvertGP 
      /click left bank silver 
      /click left bank gold 
      /click left bank silver 

   :ConvertGP 
      /if n $char(gold,bank)==0 /goto :Done 
      /click left bank gold 
      /click left bank plat 
      /click left bank gold 

   :Withdrawl
      /if $v2==-1.00 /goto :Done
     
      /for v5 0 to $v2
          /if $v5==2001 {
              /goto :Withdrawl2
           }
      /next v5

      || Method 1 -- for withdrawls of 1-2000pp
      /sendkey down ctrl
      /for v6 0 to $v2
          /click left bank plat
          /click left auto
      /next v6
      /sendkey up ctrl
      /goto :Done

   :Withdrawl2     
      /sendkey up shift
      
      || Method 2 -- for withdrawls of more than 2000pp
      /echo Performing Withdrawl.  This may take some time.
      /mouseto bank plat 
      /click left 
      /mouseto + 23 +45 
      /delay 20 
      /for v4 1 to $v3
         /delay 0 
         /click left 
      /next v4 
      /mouseto + 66 -22 
      /delay 20 
      /click left 
      /delay 5 
      /click left auto


   :Done 
   /sendkey up shift 

   /if $p1~~"nd" {
      /echo Withdrawn: $v1pp
   } else /if $v2==-1.00 {
      /echo Deposited: $Amountpp
   } else {
      /echo Deposited: $Amountpp     ++     Withdrawn: $v6pp
   }

/return 
Last edited by Amadeus on Sun Jul 21, 2002 6:50 pm, edited 3 times in total.

User avatar
Goge
Macro Author
Macro Author
Posts: 71
Joined: Sat Jun 15, 2002 11:55 am
Location: Terra

Post by Goge » Sun Jul 21, 2002 2:26 am

an easyer way might just be to click the right button on that plat slide bar as many times as the plat you want to take out -1. (because you start at 1 plat. (or do you start with a full bar and need to work backwards?)

if its backwards sub you # from the plat and take the new number and click the left button that many times.

i had done something simular before.
i'll look into this. seems fun :)
He who sleep with Itchy arse wake with Smelly finger.

User avatar
Goge
Macro Author
Macro Author
Posts: 71
Joined: Sat Jun 15, 2002 11:55 am
Location: Terra

Post by Goge » Sun Jul 21, 2002 3:20 am

after some research my meathod does work.
here you go.

Code: Select all

Sub main
   /varcalc v61 $char(plat,bank) - $p0
   /echo $v61
   /mouseto bank plat
   /click left
   /mouseto + 23 +45
   /delay 20
   /for v62 1 to $v61
      /delay 0
      /click left
   /next v62
   /mouseto + 66 -22
   /delay 20
   /click left
   /delay 5
   /click left auto.
/return
Last edited by Goge on Sun Jul 21, 2002 3:03 pm, edited 1 time in total.
He who sleep with Itchy arse wake with Smelly finger.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 21, 2002 5:16 am

Hmmm....How are you sure where to place the mouse? I was under the impression that folks could move their "select money" dialog box around the screen and then the location would be different for everyone...

That was the reason I didn't go that route; but, perhaps I was overanalyzing it :)

User avatar
Goge
Macro Author
Macro Author
Posts: 71
Joined: Sat Jun 15, 2002 11:55 am
Location: Terra

Post by Goge » Sun Jul 21, 2002 8:09 am

if you just /click left plat the mouse dosn't move and the thingy comes up right? well if you notice the mouse always is located at the top left corner of the box. so from there i move the mouse to the button and press it the right amount of times. then from the left slidebar button i move the mouse to the done button. It worked for me and it works even if you don't put a /mouseto bank plat. You could really just use a /click left bank plat and it should / will still work.

thats why the mouse movement is relative and i have the mouse move to the right location before clicking on the plat. :) this way it is always (or should at least always be) in the right place.

also this would work for any of the money slots. and maybe even items...
yes this Does work for items too! omg i fixed a problem i had months ago and wasn't even thinking about it! eek... i'm an idiot. i should have seen this b4.
He who sleep with Itchy arse wake with Smelly finger.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 21, 2002 2:30 pm

Wild, this didn't dawn on me either.

I will edit the macro soon and repost with this concept in mind -- it should be more resources friendly.


What was the highest amount of pp you tested this new code for?

User avatar
Goge
Macro Author
Macro Author
Posts: 71
Joined: Sat Jun 15, 2002 11:55 am
Location: Terra

Post by Goge » Sun Jul 21, 2002 3:02 pm

okay i improved my code up top to work.
The way this works is that everything is backwards. so actually the higher number you want to take out (or closer to your ammount) is faster.

Speed tests:
Without #turbo
[2002/07/21 15:15:40] 6 seconds, 30.00 clicks, 15.00 clicks/second
[2002/07/21 15:19:19] 78 seconds, 2000.00 clicks, 27.03 clicks/second

With #turbo
[2002/07/21 15:17:01] 5 seconds, 30.00 clicks, 30.00 clicks/second
[2002/07/21 15:22:49] 30 seconds, 2000.00 clicks, 76.92 clicks/second

Clocking Code:

Code: Select all

   /varcalc v63 $running - 4
   /varcalc v64 $v61/$v63
   /mqlog $running seconds, $v61 clicks, $v64 clicks/second
He who sleep with Itchy arse wake with Smelly finger.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sun Jul 21, 2002 3:30 pm

Salutations,
wait... so does the code work for over 2000 now then?

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 21, 2002 3:55 pm

Edit:
Last edited by Amadeus on Sun Jul 21, 2002 6:52 pm, edited 1 time in total.

User avatar
Goge
Macro Author
Macro Author
Posts: 71
Joined: Sat Jun 15, 2002 11:55 am
Location: Terra

Post by Goge » Sun Jul 21, 2002 4:41 pm

][=][D ][=][D

Liz. yes, i don't think (with the new code) that there is a limit, only that you need to wait more time the smaller the # you want to take back.

as a work around keep the money on you enstead of dumping it all to the bank first.
He who sleep with Itchy arse wake with Smelly finger.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 21, 2002 6:52 pm

Macro edited to incorporate Goge's method of withdrawl for withdrawls of more than 2000pp.

As far as I can test it, should be working perfectly. However, for those with a LOT of platinum, you may not find the script useful when withdrawing amounts of 5000, for example.

Also ... I just noticed that this block of code:

Code: Select all

      /for v5 0 to $v2 
          /if $v5==2001 { 
              /goto :Withdrawl2 
           }
      /next v5 
...should probably be this:

Code: Select all

          /for v5 0 to $v2 
          /if $v5==2001 /goto :Withdrawl2 
          /next v5
...for cleanliness sake; however, I'm going to leave it as is at the top just to make it easier if someone else wants to put in other features/checks at that point.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Mon Jul 22, 2002 12:52 pm

Salutations,
how i do withdrawls: get it close using something called a 'human' *gasp* then have a macro that does a for loop with /click left in it... put mouse over direction i want and... click away.... of course this is stoopid... but whatever...

FlashG
Contributing Member
Contributing Member
Posts: 104
Joined: Thu Jul 11, 2002 6:38 pm

/h

Post by FlashG » Mon Jul 22, 2002 2:51 pm

L124rd, I sense a bit of sarcasium (sp). BTW can some one write me a macro that "hails" a person if the person "hails" me.

User avatar
Goge
Macro Author
Macro Author
Posts: 71
Joined: Sat Jun 15, 2002 11:55 am
Location: Terra

Post by Goge » Mon Jul 22, 2002 5:00 pm

][=][D ][=][D

Liz, lemme alone! i didn't see you come up with any code :P

and stop painting the yellow submarine green damn it!
He who sleep with Itchy arse wake with Smelly finger.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Mon Jul 22, 2002 7:58 pm

Salutations,

Code: Select all

#event hail "says, 'Hail, charnamehere'"
sub main
 :loop
   /doevents
  /goto :loop
/return

sub hail
 /varset a(0,0) $arg(1,$p0)
 /target $a(0,0)
 /echo $a(0,0) just hailed you...
 /hail
/return
dunno if that really works, but its close...
We all live in a yellow submarine,
we hate the stupid thing,
we wanna paint it green...