bazaar.mac - Complete Bazaar Buy and Sell Script

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

User avatar
Dniper
a lesser mummy
a lesser mummy
Posts: 71
Joined: Tue Nov 25, 2003 2:54 pm

Post by Dniper » Sat Dec 13, 2003 2:16 pm

Excellent work. I've gotten it to mostly work.

I myself have been very lazy when selling some things. I've sold Forest Loops for 25pp (Vender value: 300pp), heh.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Sun Dec 14, 2003 4:52 pm

If you want to remove the .00 at the end of the numbers just put the variable inside $int().
For example, change $ini(@file,names,val@counter) to $ini(@file,names,val$int(@counter)).

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Sun Dec 14, 2003 5:02 pm

good point...maybe I will do that soon

rizzah
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sat Dec 13, 2003 2:18 am

Post by rizzah » Mon Dec 15, 2003 2:07 am

okay, ive been playing around with the fact that when you have an ini with diamond in it for instance you get more items back then just diamond, you get diamond dust, flawed diamonds and what not so...

Code: Select all

#turbo

sub main
| Declaring Varibles
/declare l1 local
/declare counter local
/declare file global
/declare traderid local
/declare price local

/declare length local

/declare index local
| setting variables
/varset file C:\mq2\macros\bazaar.ini
/varset counter 1

:main
/if "$ini(@file,names,val@counter)"=="NOTFOUND" {
	/goto :end
}
/echo searching for $ini(@file,names,val@counter)
/varset length $strlen($ini(@file,names,val@counter))
/bzsrch race any class any $ini(@file,names,val@counter)
:search
/delay 1
/if "$bazaar()"=="FALSE" /goto :search
/if n $bazaar(count)==0 {
    /echo @item not found, continuing on...
    /varadd counter 1
    /goto :main
        }
}
/if n $bazaar(count)>1 {
      /for l1 0 to $calc($bazaar(count)-1)
         /if "$ini(@file,names,val@counter)"=="$left(@length,"$bazaar(@l1,name)")" {
            /varset price $bazaar(@l1,price)
            /varset traderid $bazaar(@l1,trader)
            /varset index @l1
		/goto :next

         }
/next l1
/if n @price>=$ini(@file,prices,val@counter) {
    /varadd counter 1
    /echo @counter
    /goto :main
    }


    :Next
          /for l1 $calc(@index+1) to $calc($bazaar(count)-1)
             /if "$ini(@file,names,val@counter)"=="$left(@length,"$bazaar(@l1,name)")" {
                /if n $bazaar(@l1,price)<@price {
                   /varset price $bazaar(@l1,price)
                   /varset traderid $bazaar(@l1,trader)

                }
             }
      /next l1
      /echo targeting @traderid
      /target id @traderid
      /delay 5s
      /varadd counter 1
      
      /press esc
      /goto :main
      :end
      /return
The problems i'm having is with is
1)the val2.00 name isnt setting correctly
2)i'm targeting the same trader from val1 after it gets incremented to val2.00
3) I think there may be a problem with items longer than a word

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Movement problems

Post by RDPidb » Mon Dec 15, 2003 2:17 pm

I try runnign this script but am havign some difficulty.

The movemnt just isn't workign for me, it seems to move back and forth in one area turnign right and left, back and fourth but not actualy moving towards the targeted merchant.

Has anyone else had this problem?
-Ryan

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Mon Dec 15, 2003 2:19 pm

Yes, same exact thing was happening to me, which is why I removed the movement part.

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Post by RDPidb » Mon Dec 15, 2003 2:26 pm

I see, I wish i had more time to learn the MQ scripting language, maybe next week after im done with finals , bleh :(

If anyone has corrected this problem please PM me if you are willing, I am willign to try and fix it myself, so any hints / tips woudl be appreciated also.

thanks everyone.
-Ryan

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Mon Dec 15, 2003 2:47 pm

I have gone through the script and cleaned up alot of parts. In the newest version I implemented the walkpth macro so now it not only walks to the correct places without flaw but it does so smoothly which will make it look much less fake. I am still trying to fix a few things so I will try to get a new version up when I am done.

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Tue Dec 16, 2003 10:42 am

In the newest version
Were is this newer version?

Bob

User avatar
Dniper
a lesser mummy
a lesser mummy
Posts: 71
Joined: Tue Nov 25, 2003 2:54 pm

Post by Dniper » Tue Dec 16, 2003 11:18 am

He hasn't posted it yet, still worken on ironing out a few bugs I'm guessing.

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Post by RDPidb » Tue Dec 16, 2003 2:50 pm

Ok, I added this to see whats going on

Sub movetoloc(xloc,yloc)
/echo inside movetoloc
/declare MyXLOC local
/declare MyYLOC local
/declare ObstCount local

/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:locloop

/echo @obstcount <--------this part
/echo @xloc <----------
/echo @yloc <------------

/face loc @xloc
/if "@yloc"=="u" /Press u
/call AutoRun 1
/varadd ObstCount 1
/if n @ObstCount>=3 {


and Im getting
the folloiwing output:
@obstcount
-840, -136
@yloc


anyone have any idea why its doign this, and how to fix it?


This definantly explains why it twitches and runs in a circle ...

jdelpheki
a lesser mummy
a lesser mummy
Posts: 51
Joined: Tue Dec 09, 2003 2:46 pm

Auto walk funtion

Post by jdelpheki » Tue Dec 16, 2003 4:15 pm

i got a few traders on my server that pride themselves in starting a trader on top of the stalls is there a way to make a list of the traders that you commonly cant get too in the bazaar and automatically discard there items or exclude them from the search ?

current line of thinking is if you have to use the hit obsticle code more than 4 times on one trip to the trader it would add him or her to the list of unusable traders

If you replace your /sub autowalk code in the default routines.mac file from this

(((I deleted oall my original walk code)))

to this

Sub AutoRun
/if @Param0==1 /sendkey down up
/if @Param0==0 /sendkey up up
/return

You can move :)

[/quote]
Time to die A microwave Burrito!

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Post by RDPidb » Tue Dec 16, 2003 4:30 pm

Thanks i already figured that out through trial and error, and a few other problems too, , as for traders too high, can you get a z axis number for a target in MQ ? if so it woudl be pretty simple to avoid these guys. just exclude them is the difference between your Z loc, and thier zloc is greater than say 5 or 6 ( whatever the hight of some of the barrels / ovens / etc is ...cause soem peopel like to sit on those and/or levitate)

also, please remove the cross zone targeting in the new version driftin .. im paranoid about that :)

-Ryan

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Post by RDPidb » Tue Dec 16, 2003 4:40 pm

Yeah I just checked, you can do a $target(x,y,z) and $char(x,y,z) then just check the difference between $char(z) and $target(z)

-Ryan

jdelpheki
a lesser mummy
a lesser mummy
Posts: 51
Joined: Tue Dec 09, 2003 2:46 pm

/re hrmmm

Post by jdelpheki » Tue Dec 16, 2003 4:42 pm

sweet ill try that out. any word on when the bazaar macro will get released
Time to die A microwave Burrito!