[Question] vend refill

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Message
Author
vespercore02
Noob
Noob
Posts: 18
Joined: 15 Nov 2010, 11:40
Noob?: No

[Question] vend refill

#1 Post by vespercore02 »

Code: Select all

automacro openshop {
       delay 1
            console /Not allowed other player view Equipment/
            console /All Players ignored/
            call {
                    
                    if (@cartamount (Yellow Potion) == 0) goto get
                    if (@cartamount (Orange Potion) == 0) goto get
                    pause 3
                    do openshop
                    pause 10
                    do sit
                    stop
            :get
                    $location = $.pos
                    do talk @npc (146 89)
		    pause 3
		    do talk cont
		    pause 3
		    do talk resp 1
		    pause 3
		    do storage get @storage (Yellow Potion) @eval (50 - @cartamount (Yellow Potion))
		    do storage get @storage (Orange Potion) @eval (50 - @cartamount (Orange Potion))
		    pause 3
		    do cart add @inventory (Yellow Potion) @invamount (Yellow Potion)
		    do cart add @inventory (Orange Potion) @invamount (Orange Potion)
                    pause 10
                    do cart add Orange potion                    
                    do cart add Yellow potion
                    pause 1
                    do move $location
                    pause 3
                    do openshop
                    pause 10
                    do sit
                    stop
            }

    }





automacro soldout {
soldout >= 2
cart "Yellow Potion" <= 1, "Orange Potion" <= 1,
 run-once 1
call {

                    $location = $.pos
                    do talk @npc (146 89)
		    pause 3
		    do talk cont
		    pause 3
		    do talk resp 1
		    pause 3
		    do storage get @storage (Yellow Potion) @eval (50 - @cartamount (Yellow Potion))
		    do storage get @storage (Orange Potion) @eval (50 - @cartamount (Orange Potion))
		    pause 3
		    do cart add @inventory (Yellow Potion) @invamount (Yellow Potion)
		    do cart add @inventory (Orange Potion) @invamount (Orange Potion)
                    pause 10
                    do cart add Orange potion                    
                    do cart add Yellow potion
                    pause 1
                    do move $location
                    pause 3
                    do openshop
                    pause 10
                    do sit
                    stop
		}
	}

is my macro ok?

i already put the password of the storage to the config

and some codes there are copy paste but itry it and it run properly

correct me if some of the macros or code are wrong :D
Last edited by Mushroom on 26 Jun 2011, 17:23, edited 2 times in total.
Reason: Added code tags

Mushroom
Perl Monk
Perl Monk
Posts: 427
Joined: 04 Apr 2008, 14:04
Noob?: No
Location: Brazil

Re: [Question] vend refill

#2 Post by Mushroom »

1st- You can't have more than one console condition in one automacro. You have 2 solutions:
- make separate automacros for each condition and make them call the same macro
- merge both console conditions using regex

2nd-
pause 3
do cart add @inventory (Yellow Potion) @invamount (Yellow Potion)
do cart add @inventory (Orange Potion) @invamount (Orange Potion)
pause 10
do cart add Orange potion
do cart add Yellow potion
I think you don't need the bold lines, because you already added all your potion in the cart (as shown in the above lines)
Quit.

Post Reply