Warp on PM | 2.07/SVN | macro 2.0.2

Moderator: Moderators

zarkon
Noob
Noob
Posts: 15
Joined: 27 Oct 2009, 01:09
Noob?: Yes

Warp on PM | 2.07/SVN | macro 2.0.2

#1 Post by zarkon »

Update: 04 Dec 2009

BUG:
- when authorized user pm "warp A" it will automatically cast the 1st slot of the list in my example here Prontera

I modified my warp seller to have a free warp function for my self or my friend to use my warp bot here the warp on pm code:

Code: Select all

macro var {
	log setting up global variables ..

	# Our Warp List
	$loc1 = Prontera
	$loc2 = Geffen
	$loc3 = Alberta
	$loc4 = Einbroch

	# Set Map to warp here
	$wslot1 = prontera
	$wslot2 = geffen
	$wslot3 = alberta
	$wslot4 = ein_fild08
}
	# DO NOT EDIT ANYHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!
	# YOU HAS BEING WARN!


# Loading our var	
automacro start {
	delay 2
	console /other player view Equipment/i
        call {
		# call our main variables and lock auto-restock function
		do reload warpm # change this to the files you save this macro (sometime macro script need to be reloaded)
		call var 
		# check Gem amount
                if (@invamount (Blue Gemstone) = 0) goto qk
                pause 3
                do sit
                stop
      :qk
      lock pm
      do chat create "OUT OF SERVICES!" 2 0 12121
      stop
        }

}

automacro pm {                               
        console /\(From: (.*)\) : warp (.*)/
        call {
      	$name = $.lastMatch1
      	# All people that can use warp need to be added in overallAuth
	$auth = @eval (defined $::overallAuth{"$name"} ? $::overallAuth{"$name"}:"None")
	if ($auth == 1) goto auth
      		do pm $.lastMatch1 Pardon...?
      		stop
		:auth         
		# AGI UP you can add more buff here too
                do sp 29 $name 10
                $z = $.lastMatch2
                if ($z = $loc1) goto p1
                if ($z = $loc2) goto p2
                if ($z = $loc3) goto p3
                if ($z = $loc4) goto p4
		        :p1
                                call w1
                                stop
                        :p2       
                                call w2
                                stop
                        :p3
                                call w3
                                stop
                        :p4
                                call w4
                                stop
        }
}

macro w1 {
	lock pm
	$aa1 = @Invamount (Blue Gemstone)
	# Opening Warp on Empty Spot
        $x = @arg("$.pos", 1)
        $y = @arg("$.pos", 2)
        $x0 = @eval($x + @rand(1,3))
   	$x1 = @eval($x - @rand(1,3))
        $y0 = @eval($y - @rand(1,3))
        do sl 27 @random("$x0", "$x1") $y0
        pause 2
        do warp $wslot1
        pause 2
        $aa2 = @Invamount (Blue Gemstone)
        if ($aa1 == $aa2) goto ax
        stop

	:ax
	 pause 2
        # Warp Cast Failed re-casting
        call axx
        stop
        }

macro axx {
        call w1
}

macro w2 {
	lock pm
	$bb1 = @Invamount (Blue Gemstone)
	# Opening Warp on Empty Spot
        $x = @arg("$.pos", 1)
        $y = @arg("$.pos", 2)
        $x0 = @eval($x + @rand(1,3))
   	$x1 = @eval($x - @rand(1,3))
        $y0 = @eval($y - @rand(1,3))
        do sl 27 @random("$x0", "$x1") $y0
        pause 2
        do warp $wslot1
        pause 2
        $aa2 = @Invamount (Blue Gemstone)
        if ($bb1 == $bb2) goto bx
        stop

	:bx
	 pause 2
        # Warp Cast Failed re-casting
        call bxx
        stop
        }

macro bxx {
        call w2
}

macro w3 {
	lock pm
	$cc1 = @Invamount (Blue Gemstone)
	# Opening Warp on Empty Spot
        $x = @arg("$.pos", 1)
        $y = @arg("$.pos", 2)
        $x0 = @eval($x + @rand(1,3))
   	$x1 = @eval($x - @rand(1,3))
        $y0 = @eval($y - @rand(1,3))
        do sl 27 @random("$x0", "$x1") $y0
        pause 2
        do warp $wslot1
        pause 2
        $aa2 = @Invamount (Blue Gemstone)
        if ($cc1 == $cc2) goto cx
        stop

	:cx
	 pause 2
        # Warp Cast Failed re-casting
        call cxx
        stop
        }

macro dxx {
        call w3
}

macro w4 {
	lock pm
	$dd1 = @Invamount (Blue Gemstone)
	# Opening Warp on Empty Spot
        $x = @arg("$.pos", 1)
        $y = @arg("$.pos", 2)
        $x0 = @eval($x + @rand(1,3))
   	$x1 = @eval($x - @rand(1,3))
        $y0 = @eval($y - @rand(1,3))
        do sl 27 @random("$x0", "$x1") $y0
        pause 2
        do warp $wslot1
        pause 2
        $dd2 = @Invamount (Blue Gemstone)
        if ($dd1 == $dd2) goto dx
        stop

	:dx
	 pause 2
        # Warp Cast Failed re-casting
        call dxx
        stop
        }

macro dxx {
        call w4
}

# Last Part after warp succesfully opened

automacro last {
        console /You opened Warp Portal on \((.*), (.*)\)/
        call {
                if (@invamount (Blue Gemstone) = 0) goto qk
                pause 2
      		release pm
                do sit
      	stop
	:qk
	do sit
        lock pm
	do chat create "OUT OF SERVICES!" 2 0 12121
	stop
        }
}
Please test it and let me know if does not work, btw most of the code are combined from various source so it not original mine I only added the var for easy editing

Cheers
Last edited by zarkon on 03 Dec 2009, 22:23, edited 1 time in total.
My Flickr | Blog
Status: Idle!
janreishimry
Noob
Noob
Posts: 3
Joined: 15 Nov 2009, 01:34
Noob?: Yes

Re: Warp on PM | 2.07/SVN | macro 2.0.2

#2 Post by janreishimry »

hellow there friend.. ive been in the forums lately,. but its my first ffew days to read and study macro botting..
I appreciate what you shared here, and im very interested and willing to discuss that macro script with you.. I want to help too as much as i can..

To start with, may i ask some clarifications first, and i'll try to suggest simpler codes for them,.
first.. the push button, or activator:
automacro start {
delay 2
console /other player view Equipment/i ***(does this line mean that to activate the warper, u must have to right click the warper and click view Equipment?)***

Second.. perhaps we can add a macro to revert this..incase if a player (his name is on the overallAUth) gives a blue gemstone to him.. (of course, we also need to make an automacro to accept it automatically and close the deal.. ) what do u think? :)
# check Gem amount
if (@invamount (Blue Gemstone) = 0) goto qk
pause 3
do sit
stop
:qk ...
3rd.. i have a question here.. what's this $z variable for?
# AGI UP you can add more buff here too
do sp 29 $name 10
$z = $.lastMatch2
I havent tested your script yet, ill be doing so after i understand the partial parts of the script u posted..
I'd be posting my test results too, and suggestions when i do so..
thats for now..
zarkon
Noob
Noob
Posts: 15
Joined: 27 Oct 2009, 01:09
Noob?: Yes

Re: Warp on PM | 2.07/SVN | macro 2.0.2

#3 Post by zarkon »

ok here goes:

1st question:

Code: Select all

console /Not allowed other player view Equipment/i
is our trigger this msg will always show right after out bot logged in to the server, of course you can use other condition to trigger the macro such as location etc etc

2nd question:

Code: Select all

# check Gem amount
if (@invamount (Blue Gemstone) = 0) goto qk
pause 3
do sit
stop
:qk ...
this code to check current amount of gem stone the bot have so it wont be casting warp with 0 gems stone coz that will make bot cast warp portal endlessly we dont want that dont we? :p, of course you can make the bot warp when you deal him a gem stone too with some modification it can be done you just need to know how to trigger them there are couple of sample here try searching "selling warp" in this section

3rd question:

Code: Select all

$z = $.lastMatch2
this baby refer to regex from

Code: Select all

console /\(From: (.*)\) : warp (.*)/

Code: Select all

(From: (.*)\)
equal to $.lastMatch1 and

Code: Select all

warp (.*)/
is $.lastMatch2

hope that clear enough :D

by the way this scrip are actually part of my warp selling bot so it does work :)
My Flickr | Blog
Status: Idle!
978972222
Human
Human
Posts: 22
Joined: 26 May 2008, 01:42
Noob?: No

Re: Warp on PM | 2.07/SVN | macro 2.0.2

#4 Post by 978972222 »

Code: Select all

automacro last {
        console /You opened Warp Portal on \((.*), (.*)\)/
        call {
                if (@invamount (Blue Gemstone) = 0) goto qk
                pause 2
            release pm
                do sit
         stop
   :qk
   do sit
        lock pm
   do chat create "OUT OF SERVICES!" 2 0 12121
   stop
        }
}
Would be effective if change to this i guest

Code: Select all

automacro last {
        console /Inventory Item Removed: Blue Gemstone/
        call {
                if (@invamount (Blue Gemstone) = 0) goto qk
		do c Dah bukak la.. jalan keliling skit tgk
                do sit
         stop
   :qk
   do sit
        lock pm
   do chat create "OUT OF SERVICES!" 2 0 12121
   stop
        }
}
zarkon
Noob
Noob
Posts: 15
Joined: 27 Oct 2009, 01:09
Noob?: Yes

Re: Warp on PM | 2.07/SVN | macro 2.0.2

#5 Post by zarkon »

nope, it just the same thing just different way of triggering the last macro, plus i don't really like to make my bot talk :p it a mute bot :lol: so the do c command is useless less script it run less memory/cpu used :)

note: there a bug in prontera map (mro) gems stone removed even the warp casted and failed that why most of the warp selling bot in prontera city gone crazy sometime not recasting warp so the trigger i put here is best way (for me that is) to trigger the last macro :)
My Flickr | Blog
Status: Idle!