In Diesem Packet sind noch andere Dateien, wie auto BUFF Macro etc.
UND DER REQUIA RF BOT!!!!!!!!
(ALSO WER DAS PROGRAMM REQUIA HAT BITTE ICH AUCH HOCHZULADEN UND MIT UNS ZU SHAREN, DANKE!)
(den Bot den ich grad versuche hinzukriegen, damit er autoatacked ist der im rar format : Fully AUTO all RF Bot (In Development) ).
VIel SPaß ^^
und für die die es nicht runterladen können hier die source :
Main.mac
map.macQuote:
// DAVE'S RF ONLINE MACRO
// Make sure your screen resolution is set to 800 x 600!
INCLUDE E:\Downloads\Bot Collection\Fully AUTO all RF Bot (In Development)\objects.mac // macro file containing the defined objects
INCLUDE E:\Downloads\Bot Collection\Fully AUTO all RF Bot (In Development)\map.mac // include macro for path-finding
CONSTANTS
//** USER SETTINGS ************************************************** ********************************
// Make sure to set up this stuff:
ExePath = C:\Game\RF\RF Abyss.exe // location of RF.exe
Username = user // your RF Online account Username
Password = pass // your account Password
Race = 2 // Accretia = 1, Bellato = 2
Mode = 1// Sets the bot's behavior. Value is either 0 or 1
// 0 - Passive mode: bot only acts as an assistant, handling potion use, combat skill spamming,
// buffs and looting. You have to click on the mob to initiate combat, otherwise the bot
// just stands still. Use this mode if you just want to stay in 1 spot and buff yourself
// over and over.
// 1 - Aggressive mode: bot actively searches out targets on the radar screen and engages.
// Make sure to set the KS_Range if you're worried about KSing.
Loot_timer = 4 // # of seconds to loot, 2 is good for normal mobs, 4 for Ace mobs (more loot)
//0-5 // use 0 to disable looting
MAU_Mode = 0 // Bellato ONLY: 0 - on foot 1 - In a MAU
KS_Range = 12 // how far a mob has to be from a player on the radar screen for it to be targeted
// 0-20 // 0 means any mob can be targeted, regardless of any nearby players (SAWSAW mode)
// Use values from 0 to 20, I find 12 to be good
MapMove = 1 // whether to move around the map or not when idle, 0 or 1
AutoReconnect = 0 // set to 1 if you want to restart RF automatically if the game crashes. 0 if not
// 0 or 1
AutoSpam = 0 // 0 - off , 1 - autospam potion button
Buff_Mode = 0 // 0 or 1
//** KEYS ************************************************** *****************************************
// From your hotkey bar: {F1} to {F10}
Attack_Skill = {F1} // your main combat skill: ex) Shining Cut, Fast Shot...
Attack_Skill2= {F2}
Health_Pot = {F3} // your health potions
FP_Pot = {F4} // your mana potions
SP_Pot = {F10} // your stamina potions
BUFF1 = {F5} // Buff slot 1
BUFF2 = {F6} // Buff slot 2
BUFF3 = {F7} // Buff slot 3 , Combat buff
BUFF4 = {F8} // Buff slot 4
BUFF5 = {F9} // Buff slot 5
//************************************************** *************************************************
// SYSTEM VARIABLES - do not touch ------------------------------------------------------------------
color_variance = 10 // used in ObjVariance
click_delay = 18 // # of milliseconds between clicks in Target4
ZOOM_OUT = 6 // how far to zoom out
pixel_tries = 2 // number of RGB checks per pixel
pixel_delay = 200 // delay in ms between pixel checks in IS_MOB
TARGET_INC = 80 // used by Target4
Player = 0 // name of the player object to be used : Accretia or Bellato
//check_flag = 1 // 0 -> do not check if target is player/high lvl mob, 1 -> check ** OUTDATED **
//Player_check = 30 // counter for player pixel-checking in Is_Mob ** OUTDATED **
load = 0 // used by Login
IS_MOB1=0 // mob pixel 1 (red)
IS_MOB2=0 // mob pixel 2 (white)
IS_MOB3=0 // mob pixel 3 (black)
USE_POT = 0 // used in Check_HP
IN_COMBAT=0
USE_HP_POT=0
USE_FP_POT=0
TIME=0
XPOS2=0
YPOS2=0
YPOS3=0
YMID2=250
XMIN2=5
XMAX2=737
YMIN2=30
YMAX2=490
XMIN=690
YMIN=40
XPOS=0
YPOS=0
XMAX=770
YMAX=125
MOUSEX = 0
MOUSEY = 0
ScreenX = 0 // screen x,y coordinates
ScreenY = 0
ACTIVATE = 1 // flag to skip window change procedure
STRAFE_LEFT = q
STRAFE_RIGHT = e
FIND_AGAIN = 0 // flag to indicate whether a search must be performed again immediately
NEAR_YELLOW = 0 // flag to indicate if a yellow dot is at the center of the radar
PEACE=0
XMOVE=0
YMOVE=0
MOUSE_MOVE=0
BUFF_INTERVAL = 0
radar_left = 690 // radar left X value
radar_right = 770 // radar right X value
radar_top = 40 // radar top Y value
radar_bottom = 125 // radar top Y value
xmid = 0 // 730
ymid = 0 // 82
x = 0
y = 0
x1 = 0
y1 = 0
x2 = 0
y2 = 0
temp = 0 // used for computations
START = 1
//------------------------------------------------------------------------------------------------
End // end CONSTANTS
//************************************************** **********************************************
// MAIN CALLER - it all starts here...
if $START = 1 // make sure macro only runs once, because log gets overwritten when game crashes
Set START = 0
else
stop
end
IsWindow RF Online // check for RF Online window
set ACTIVATE = 1 // disable window event processing, we are switching windows back to RF
timestamp Restarting RF Online...
SetActiveWindow RF Online // RF is running, set active window to RF
delay 5 sec
set ACTIVATE = 0 // we are back in-game, enable window event processing
call Main // do the stuff...
else // RF window does not exist, Login
stop
//set ACTIVATE = 1
//timestamp Starting RF Online...
//call Login
//call Initialize
//delay 2 sec
//set ACTIVATE = 0
//call Main
end
// END MAIN CALLER
//************************************************** **********************************************
Procedure Is_mob // checks if we have a target
call Check_HP
// new procedure for target-checking, uses objects defined in objects.mac
timestamp STARTING IS_MOB-------------------------------------------------------
If $MODE = 1 // bot is on Aggressive mode, check if target is a player
// Check if the target is a player
//timestamp PLAYER CHECK ($Player) --------------------------------------------
IsObject $Player at 375, 66
TIMESTAMP PLAYER FOUND! ************************************************** **
Set IS_MOB3 = 0 // target is a player
keydown 200 {ESC} // un-target
delay 200
keydown 200 {ESC}
delay 200
keydown 200 {ESC}
//set Player_check = 0 // reset counter
SET FIND_AGAIN = 1 // search for another target immediately
//timestamp END PLAYER CHECK ------------------------------------------------
exit
End // end player check
//timestamp END PLAYER CHECK ------------------------------------------------
End // end If MODE
Loop $pixel_tries
delay $pixel_delay
// Check the upper left and lower right of targeting icon
//IsObject Upper_Left at 330, 39 // check upper left portion of targeting icon
isobject Left at 356,68
Set IS_MOB1 = 1 // set 1st flag
Else
continue // search failed, continue to next loop iteration
End
//IsObject Lower_Right at 461, 64 // check lower right portion of targeting icon
isobject right at 440,69
Set IS_MOB2 = 1 // set 2nd flag
Set IS_MOB3 = 1 // set 3RD flag
timestamp EXITING IS_MOB-------------------------------------------------------
exit // mob found!
Else
continue
end
End // Loop $pixel_tries
timestamp EXITING IS_MOB-------------------------------------------------------
End
(*
Procedure Is_mobOLD // old procedure, uses single pixels instead of objects
// checks 3 different pixel locations to determine if a monster is currently targeted
// added a loop to check pixels multiple times, and a delay
Loop $pixel_tries
IsRed 395, 54
Set IS_MOB1 = 1
End
IsWhite 474, 52
Set IS_MOB2 = 1
End
IsBlack 368, 70
Set IS_MOB3 = 1
End
// do not target players, high lvl mobs
if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1 and $check_flag = 1
IsBlack 457,49
else // not black, probably player
IsBlack 457,50 // check another pixel
else // still not black
loadrgb 457,49
timestamp {rgbred} {rgbgreen} {rgbblue}
inc Player_check
end
end
///
loadrgb 457,49
if {rgbred} = 24 and {rgbgreen} = 24 and {rgbblue} = 24
else // not black, probably player
loadrgb 457,50 // check another pixel
if {rgbred} = 24 and {rgbgreen} = 24 and {rgbblue} = 24
else // still not black
delay 100 // do it yet again, after a delay
loadrgb 457,49
if {rgbred} = 24 and {rgbgreen} = 24 and {rgbblue} = 24
else // not black, probably player
loadrgb 457,50 // check another pixel
if {rgbred} = 24 and {rgbgreen} = 24 and {rgbblue} = 24
else // still not black, more or less sure now that it's a player/high lvl mob
inc Player_check
end
end
end
end
///
if $Player_check > 30 // target is probably a player/high lvl monster
keydown 200 {ESC} // un-target
delay 200
keydown 200 {ESC}
delay 200
keydown 200 {ESC}
set Player_check = 0 // reset counter
SET FIND_AGAIN = 1 // search for another target immediately
end
end
delay $pixel_delay
end
End*)
Procedure Is_mob2 // no delay, 1 pass check, used in Target4
// Checks 3 different pixel locations to determine if a monster is currently targeted
IsRed 395, 54
Set IS_MOB1 = 1
End
IsWhite 474, 52
Set IS_MOB2 = 1
End
IsBlack 368, 70
Set IS_MOB3 = 1
End
//if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1
// exit
//end
End
Procedure Combat
// will do this as long as a monster remains targeted
keys {SPACE} // engage target
keydown $Attack_Skill 100 // spam attack skill
keydown $Attack_Skill 100
keydown $Attack_Skill2 100 // spam attack skill
keydown $Attack_Skill2 100
// F7 - combat buff
keydown $BUFF3 100
keydown $BUFF3 100
delay 500
Set IN_COMBAT = 1
Call Check_HP
call Check_Ammo // only for MAU Mode
call Check_Dead
//Call Check_FP
End
Procedure Loot
// Loot by spamming x for <Loot_timer> seconds
Loop $Loot_timer // # of seconds to loot
keys x // spam Loot button 4 times per second
delay 250
keys x
delay 250
keys x
delay 250
keys x
delay 250
End
End
Procedure Check_HP // below 1/2
// Check for auto-spam
if $AutoSpam = 1
keys $Health_Pot
delay 50
keys $Health_Pot
exit
end
// Checks whether HP is below the threshold value
if $USE_POT = 1
keys $Health_Pot
delay 50
keys $Health_Pot
delay 50
keys $Health_Pot
end
IsGrey 161, 19 //159, 20
(*
keys $Health_Pot
delay 50
keys $Health_Pot
delay 50
keys $Health_Pot
*)
Set USE_POT = 1
else
// only enable for tough mobs
IsGrey 181, 20 // 75%
Set USE_POT = 1
else
Set USE_POT = 0
end
set USE_POT = 0
End
End
Procedure Check_FP // below 1/4
// Checks whether FP is below the threshold value
IsGrey 116, 38
keys $FP_Pot
delay 50
keys $FP_Pot
delay 50
keys $FP_Pot
End
End
Procedure Check_SP // below 1/4
// Checks whether SP (stamina) is below the threshold value
IsGrey 116,48//160, 48
keys $SP_Pot
delay 50
keys $SP_Pot
delay 50
keys $SP_Pot
End
End
Procedure Target4 // click wildly on the screen to target a close enemy
SET XPOS2 = $XMIN2
SET YPOS2 = $YMID2
SET YPOS3 = $YMID2
//timestamp ENTERING TARGET4... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// close CW popup----
//MousePos 686, 219
//delay $click_delay
//delay $click_delay
//leftclick
// ------------------
while $YPOS2 < $YMAX2 and $YPOS3 > $YMIN2
SET XPOS2 = $XMIN2
while $XPOS2 < $XMAX2 // top horizontal line (left to right)
//15
//leftmousedown
if $XPOS2 > $XMIN2 AND $XPOS2 < $XMAX2 // make sure pos is within boundaries of screen
//timestamp MOUSEPOS $XPOS2, $YPOS2 ----------------------------------
MousePos $XPOS2,$YPOS2
delay $click_delay
leftclick
end
//doubleclick
compute XPOS2 = $XPOS2 + $TARGET_INC
end
SET XPOS2 = $XMAX2
while $XPOS2 > $XMIN2 // bottom horizontal line (right to left)
//15
//leftmousedown
if $XPOS2 > $XMIN2 AND $XPOS2 < $XMAX2 // make sure pos is within boundaries of screen
//timestamp MOUSEPOS $XPOS2, $YPOS3 ----------------------------------
MousePos $XPOS2,$YPOS3
delay $click_delay
leftclick
end
//doubleclick
compute XPOS2 = $XPOS2 - $TARGET_INC
end
call is_mob2
if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1 // check if target was found
set FIND_AGAIN = 0
mousepos 300,300 // center cursor
//timestamp EXITING TARGET4...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>
exit
end
compute YPOS2 = $YPOS2 + $TARGET_INC
compute YPOS3 = $YPOS3 - $TARGET_INC
end // end main WHILE loop
//keys {space} // select target
call is_mob2 // check if target display is showing
if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1 // check if target was found
set FIND_AGAIN = 0
exit
else
set FIND_AGAIN = 1 // no target found, search again immediately
end
timestamp EXITING TARGET4...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>
end // END target4
(*
Procedure Target5 // searches radar for yellow dots, speed is important
// gets the closest yellow dot to your position
//ObjLoadWindow TRUE
compute xmid = TRUNC(( $radar_left + $radar_right ) / 2)
compute ymid = TRUNC(( $radar_top + $radar_bottom ) / 2)
set x1 = $xmid
set y1 = $ymid
set x2 = $x1
set y2 = $y1
ReleaseGlobalScreen
InitFlag
SaveGlobalScreen
timestamp STARTING RADAR SEARCH...
while $x2 <= $radar_right
set x = $x1
set y = $y1
while $x <= $x2 // check top horizontal line
//MousePos $x, $y
// check RGB, exit if found
LoadRGB $x, $y
//TimeStamp <RED {RGBRed}> <GREEN {RGBGREEN}> <BLUE {RGBBLUE}> [X = $x] [Y = $y]
if {RGBRed} = 255 and {RGBGreen} = 214 and {RGBBlue} = 94
call Move
call Target4
ReleaseGlobalScreen
exit
end
//inc x
compute x = $x + 2
end
set x = $x2
set y = $y1
while $y <= $y2 // check right vertical line
//MousePos $x, $y
// check RGB, exit if found
LoadRGB $x, $y
//TimeStamp <RED {RGBRed}> <GREEN {RGBGREEN}> <BLUE {RGBBLUE}> [X = $x] [Y = $y]
if {RGBRed} = 255 and {RGBGreen} = 214 and {RGBBlue} = 94
call Move
call Target4
ReleaseGlobalScreen
exit
end
//inc y
compute y = $y + 2
end
set x = $x1
set y = $y2
while $x <= $x2 // check bottom horizontal line
//MousePos $x, $y
// check RGB, exit if found
LoadRGB $x, $y
//TimeStamp <RED {RGBRed}> <GREEN {RGBGREEN}> <BLUE {RGBBLUE}> [X = $x] [Y = $y]
if {RGBRed} = 255 and {RGBGreen} = 214 and {RGBBlue} = 94
call Move
call Target4
ReleaseGlobalScreen
exit
end
//inc x
compute x = $x + 2
end
set x = $x1
set y = $y1
while $y <= $y2 // check left vertical line
//MousePos $x, $y
// check RGB, exit if found
LoadRGB $x, $y
//TimeStamp <RED {RGBRed}> <GREEN {RGBGREEN}> <BLUE {RGBBLUE}> [X = $x] [Y = $y]
if {RGBRed} = 255 and {RGBGreen} = 214 and {RGBBlue} = 94
call Move
call Target4
ReleaseGlobalScreen
exit
end
//inc y
compute y = $y + 2
end
// increment vars (bigger square to loop)
//dec x1
compute x1 = $x1 - 2
//inc x2
compute x2 = $x2 + 2
//dec y1
compute y1 = $y1 - 2
//inc y2
compute y2 = $y2 + 2
end
//ObjRelease
ReleaseGlobalScreen
timestamp ENDING RADAR SEARCH
End
*)
Procedure Move using ConstX, ConstY // moves to target on radar screen ( must be in keyboard mode! )
if $MAU_MODE = 0 // on foot------------------------------------------------------
// VERTICAL MOVEMENT--------------------------------------------------
if $ConstY < 82
Compute YMOVE = 80 * ( ABS ($ConstY - 82)) //150 * ( ABS ($ConstY - 82))
if $YMOVE < 850
set YMOVE = 200//300
end
//MousePos 408, 13 // - UP
MousePos 408, 2 // - UP
LeftMouseDown
delay $YMOVE
LeftMouseUp
//set MOUSEX = 12
//set MOUSEY = 256
//keydown w $YMOVE // move forward
//set STRAFE_LEFT = q
//set STRAFE_RIGHT = e
else // move down
// invert strafe buttons
//set STRAFE_LEFT = e
//set STRAFE_RIGHT = q
//middleclick // middle mouse button (turn around 180 degrees)
//delay 500
Compute YMOVE = 80 * ( ABS ($ConstY - 82)) //150 * ( ABS ($ConstY - 82))
if $YMOVE < 850
set YMOVE = 200//300
end
MousePos 410, 522 // - DOWN
//MousePos 408, 13 // - UP
LeftMouseDown
delay $YMOVE
LeftMouseUp
//keydown w $YMOVE // move forward
end
delay 500
// HORIZONTAL MOVEMENT -------------------------------------------------------
if $ConstX < 730
Compute XMOVE = 80 * ( ABS ($ConstX - 730)) //150 * ( ABS ($ConstX - 730))
if $XMOVE < 250
set XMOVE = 100
end
//if $ConstY < 82 // normal left
MousePos 12, 300//256 // - LEFT
LeftMouseDown
delay $XMOVE
LeftMouseUp
(*else // inverted left
MousePos 788, 300//270 // - RIGHT
LeftMouseDown
delay $XMOVE
LeftMouseUp
end*)
//keydown $STRAFE_LEFT $XMOVE // strafe left
else
Compute XMOVE = 80 * ( ABS ($ConstX - 730)) //150 * ( ABS ($ConstX - 730))
if $XMOVE < 250
set XMOVE = 100
end
//if $ConstY < 82 // normal right
MousePos 750,300//788, 300//270 // - RIGHT
LeftMouseDown
delay $XMOVE
LeftMouseUp
(*else // inverted right
MousePos 12, 300//256 // - LEFT
LeftMouseDown
delay $XMOVE
LeftMouseUp
end*)
//keydown $STRAFE_RIGHT $XMOVE // strafe right
end
(*if $MAU_MODE = 0 // on foot------------------------------------------------------
if $ConstY < 82
Compute YMOVE = 100 * ( ABS ($ConstY - 82)) //100 * ( ABS ($y - 75))
if $YMOVE < 850
set YMOVE = 300//300
end
keydown w $YMOVE // move forward
set STRAFE_LEFT = q
set STRAFE_RIGHT = e
else
// invert strafe buttons
set STRAFE_LEFT = e
set STRAFE_RIGHT = q
middleclick // middle mouse button (turn around 180 degrees)
delay 500
Compute YMOVE = 100 * ( ABS ($ConstY - 82)) //150 * ( ABS ($y - 75))
if $YMOVE < 850
set YMOVE = 300//300
end
keydown w $YMOVE // move forward
end
if $ConstX < 730
Compute XMOVE = 100 * ( ABS ($ConstX - 730)) //XMOVE = 100 * ( ABS ($x - 730))
if $XMOVE < 250
set XMOVE = 100
end
keydown $STRAFE_LEFT $XMOVE // strafe left
else
Compute XMOVE = 100 * ( ABS ($ConstX - 730)) //XMOVE = 100 * ( ABS ($x - 730))
if $XMOVE < 250
set XMOVE = 100
end
keydown $STRAFE_RIGHT $XMOVE // strafe right
end*)
else // in a MAU, use mouse clicks to move instead of keyboard------------------------
//MousePos 408, 13 - UP
//MousePos 12, 256 - LEFT
//MousePos 788, 270 - RIGHT
//MousePos 410, 522 - DOWN
//delay 500
(*IsObject Run at 161, 568 // check walk/run icon
timestamp already boosted
else // walk icon, turn on boost
timestamp turning on boost
keys w
End*)
// VERTICAL MOVEMENT--------------------------------------------------
if $ConstY < 82
Compute YMOVE = 80 * ( ABS ($ConstY - 82)) //150 * ( ABS ($ConstY - 82))
if $YMOVE < 850
set YMOVE = 100
end
MousePos 408, 13 // - UP
LeftMouseDown
delay $YMOVE
LeftMouseUp
//set MOUSEX = 12
//set MOUSEY = 256
//keydown w $YMOVE // move forward
//set STRAFE_LEFT = q
//set STRAFE_RIGHT = e
else // move down
// invert strafe buttons
//set STRAFE_LEFT = e
//set STRAFE_RIGHT = q
//middleclick // middle mouse button (turn around 180 degrees)
//delay 500
Compute YMOVE = 80 * ( ABS ($ConstY - 82)) //150 * ( ABS ($ConstY - 82))
if $YMOVE < 850
set YMOVE = 100
end
MousePos 410, 522 // - DOWN
//MousePos 408, 13 // - UP
LeftMouseDown
delay $YMOVE
LeftMouseUp
//keydown w $YMOVE // move forward
end
delay 500
// HORIZONTAL MOVEMENT -------------------------------------------------------
if $ConstX < 730
Compute XMOVE = 80 * ( ABS ($ConstX - 730)) //150 * ( ABS ($ConstX - 730))
if $XMOVE < 250
set XMOVE = 50
end
//if $ConstY < 82 // normal left
MousePos 12, 300//256 // - LEFT
LeftMouseDown
delay $XMOVE
LeftMouseUp
(*else // inverted left
MousePos 788, 300//270 // - RIGHT
LeftMouseDown
delay $XMOVE
LeftMouseUp
end*)
//keydown $STRAFE_LEFT $XMOVE // strafe left
else
Compute XMOVE = 80 * ( ABS ($ConstX - 730)) //150 * ( ABS ($ConstX - 730))
if $XMOVE < 250
set XMOVE = 50
end
//if $ConstY < 82 // normal right
MousePos 750,300//788, 300//270 // - RIGHT
LeftMouseDown
delay $XMOVE
LeftMouseUp
(*else // inverted right
MousePos 12, 300//256 // - LEFT
LeftMouseDown
delay $XMOVE
LeftMouseUp
end*)
//keydown $STRAFE_RIGHT $XMOVE // strafe right
end
//keys w // turn off boost
end // end if MAU_Mode
//timestamp XMOVE = $XMOVE, YMOVE = $YMOVE
end
Procedure Target6 // get x,y coords of the nearest yellow dot on the radar
MousePos 424, 284 // center mouse cursor
//SearchRadarYellow // first check if a mob is close by
if {lastX} = 0 and {lastY} = 0 // no mob close by
else // there is a mob close by
call Target4
exit
end // end if mob is close by*)
//timestamp SEARCH START--------------------------------------------------------
SearchRadar$KS_Range,4 // Sets {lastX] and [lastY] when a yellow dot is found on the radar.
// Sets 0,0 when not found
// SearchRadar n1,n2 where:
// n1 = Offset in pixels, how far away from yellow dots do we check for green dots?
// Enter 0 to disable checking for nearby players (green dots)
// n2 = Offset in pixels, how far away from the center do we start checking for nearby players?
// Enter 0 to check starting from center
//timestamp last X = {lastX}, last Y = {lastY}
//timestamp SEARCH END----------------------------------------------------------
IF {lastX} = 0 and {lastY} = 0 // no yellow dot found
else // yellow dot found, go to target and attack
//compute {lastX} = {lastX} + 2 //adjustment
//compute {lastY} = {lastY} + 2
compute x = {lastX} //+ 2
compute y = {lastY} + 3
//if $MAU_Mode = 0 // on foot
(*
SearchRadarYellow // first check if a mob is close by
if {lastX} = 0 and {lastY} = 0 // no mob close by
else // there is a mob close by
call Target4
exit
end // end if mob is close by*)
mousepos {lastX} , {lastY}
call Move $x,$y //{lastX}, {lastY}
//call move2 $x,$y
call Target4
(***
delay 500
mousepos 730,82 // debug
SearchRadarYellow
if {lastX} = 0 and {lastY} = 0 // no yellow dot, target has moved
SearchRadar $KS_Range,0 // find target on radar again
if {lastX} = 0 and {lastY} = 0
// no yellow
else
mousepos {lastX}, {lastY} // target found, move and attack
timestamp TARGET FOUND AT {LASTX}, {LASTY}
//compute {lastX} = {lastX} + 2 //adjustment
//compute {lastY} = {lastY} + 2
compute x = {lastX} //+ 2
compute y = {lastY} + 3
call Move $x,$y //{lastX}, {lastY}
//call move2 $x,$y
call Target4 // click screen
end
else // target found
call Target4
end // end if no yellow dot found ***)
(*
else // in a MAU
call CheckNearYellow // arrived at spot, check if target is still there
if $NEAR_YELLOW = 1
call Target4 // target is still there, click screen rapidly
else // target has moved, call MOVE again
SearchRadar $KS_Range,0 // find target on radar screen again
IF {lastX} = 0 and {lastY} = 0 // no yellow dot found
else // dot found, do the thing...
mousepos {lastX}, {lastY} //$x,$y
call Move {lastX}, {lastY}
call Target4 // click screen
end
end // end if NEAR_YELLOW
end // MAU mode*)
end // end no yellow dot found
End
Procedure CheckNearYellow // checks if there is a yellow dot near the center of the radar screen
// center coordinates: 730, 82
set x = 724
set y = 76
set NEAR_YELLOW = 0 // reset flag
//ReleaseGlobalScreen
//InitFlag
//SaveGlobalScreen // save screen
while $y <= 95
set x = 724
while $x <= 740
loadrgb $x,$y
if {RGBRed} = 255 and {RGBGreen} = 214 and {RGBBlue} = 94 // yellow pixel found
set NEAR_YELLOW = 1
//ReleaseGlobalScreen // release screen
exit
end
inc x
end
inc y
end // end while Y
End
procedure Login
execprogram $ExePath
// sometimes RF Launcher doesn't open, so check for it...
while $load = 0
delay 2 sec
IsWindow RF Online.
set load = 1 // launcher window found, continue
else
execprogram $ExePath
end
end // end while
set load = 0
delay 5000
// wait for login screen
while $load = 0
delay 2000
IsBlack 639, 353
Else
set load = 1
End
end
set load = 0 // reset
// enter username,password
delay 1000
keys $Username
keys {TAB}
delay 500
keys $Password
keys {RETURN}
// wait for server list
set load = 0
while $load = 0
delay 3000
IsBlack 639, 353
Else
set load = 1
End
end
//click server - Server 1: Nexus
delay 1000
MousePos 785, 215
doubleclick
// wait for main menu
while 1=1
delay 2000
IsObject Title_Red at 362, 349
break // found the red icon, continue
End
end
delay 3 sec
(*delay 12000
set load = 0
while $load = 0
delay 2000
IsRed 395, 346 // watch for that red icon
set load = 1
Else
End
end*)
// click START
MousePos 393, 458
doubleclick
//click ENTER
delay 5000
MousePos 400, 491
doubleclick
end
procedure Initialize
//Keyrate 100 // how long keys are pressed
delay 20 sec
keydown h 200 // set to keyboard mode
// change view to Overhead View
mousepos 350,50
RightMouseDown
mousepos 350,700
delay 1 sec
RightMouseUp
mousepos 350,50
delay 500
Loop $ZOOM_OUT // ZOOM_OUT = # of times to zoom out
mwheeldown // zoom out
end
end
// --------- MAIN LOOP --------------------------------------------------------------------------
procedure Main
// Set bot mode
//if $MODE = 1
// set AutoReconnect = 1
//else
// set AutoReconnect = 0
//end
set AutoReconnect = 0
if $Buff_Mode = 1
while 1 = 1
processmessages
// spam buff keys
keydown {F1} 50
keydown {F2} 50
keydown {F3} 50
keydown {F4} 50
keydown {F5} 50
keydown {F6} 50
keydown {F7} 50
keydown {F8} 50
delay 200
end // end while
end if // end buff mode
// Checking for race
CASE $Race
WHEN 1 // Accretia
Set $Player = Accretia // Accretia player object
WHEN 2 // Bellato
Set $Player = Bellato // Bellato player object
END
ObjVar $color_variance // set variance for object-checking
Call InitializeMap // for path-finding, sets waypoints
while 1 = 1 //
processmessages // process event procedures
// ------COMBAT/LOOTING-----------------------------------------------
call Is_mob
IF $PEACE > 2 // start searching if you haven't been in combat for more than N loops
if $MODE = 1
call Target6 // search radar for targets, then move up close
end
if $IN_COMBAT = 0
else // mob found
SET PEACE = 0
end
end
// check if a monster is targeted
if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1
// monster is currently targeted, run combat routine
call Combat
set PEACE = 0
else
// no monster
if $IN_COMBAT = 1
// no monster, but was in combat the previous iteration, time to LOOT
call Is_mob
if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1
else
delay 50
call Is_mob // check again to be sure
if $IS_MOB1 = 1 and $IS_MOB2 = 1 and $IS_MOB3 = 1
else
call Loot
end
end
end
// reset combat flag
Set IN_COMBAT = 0
End // end Check target
// reset monster flags
Set IS_MOB1 = 0
Set IS_MOB2 = 0
set IS_MOB3 = 0
//--------------------------------------------------------------------
//-------POTS---------------------------------------------------------
call Check_HP
call Check_FP
call Check_SP
//--------------------------------------------------------------------
//------BUFFS---------------------------------------------------------
// to do: add checking for buff icons
if $IN_COMBAT = 0 and $MAU_Mode = 0 // only buff out of combat / not in MAU
if $BUFF_INTERVAL > 5 // buff every N loops
//keys $BUFF1 $BUFF2 $BUFF3
keydown $BUFF1 50
keydown $BUFF2 50
keydown $BUFF3 50
keydown $BUFF4 50
keydown $BUFF5 50
set BUFF_INTERVAL = 0
end
//delay 1000
end
//--------------------------------------------------------------------
delay 250
COMPUTE PEACE = $PEACE + 1
COMPUTE BUFF_INTERVAL = $BUFF_INTERVAL + 1
if $FIND_AGAIN = 1 // check if we should search again right away
set PEACE = 4
set FIND_AGAIN = 0
end
timestamp PEACE = $PEACE
// MAPMOVE
if $PEACE > 10 and $mode = 1 and $MapMove = 1 // idle, no mobs on radar (only on aggressive mode)
timestamp MAP MOVE ********************************************
call MapMove
delay 1 sec
set PEACE = 0
end
call Check_Ammo // only for MAU Mode
call Check_Dead
end // end WHILE loop
end // end MAIN ---------------------------------------------------------------------------------
Procedure StopOnSwitchedWindow On WindowChange // this is triggered by the window-change event
if $ACTIVATE = 1 // RF is starting or tabbing back from Windows, do not perform any windowchange actions
delay 5 sec
//else // RF was exited, crashed due to the RF_Online.bin error or alt-tabbed, perform necessary actions
// The RF_Online.bin error consists of 2-4 error pop-ups, must close these first before calling
// the RF Launcher
// if $AutoReconnect = 1 // no delay if Reconnect = 0
// delay 5 sec
//end
// Check for the RF_Online.bin error, restart after closing all pop-ups
// IsWindow Critical Error // popup 1
// timestamp Critical Error - Program terminated (RF_Online.bin)
// keys {RETURN} // close pop-up
//Call Close_RFOnlineError // close all RF_Online.bin error pop-ups
//Restart
//else // no Critical Error found, but check for RF_Online.bin pop-ups
//Call Close_RFOnlineError
//end // end pop-up 1
// Check if RF was alt-tabbed by the user
//IsWindow RF Online // check if RF is still running
// timestamp Window change, stopping macro. // alt-tabbed, stop macro
// stop
//else // RF was exited by the user, or crashed through some other error
// if $AutoReconnect = 0
// timestamp Game exited, stopping macro. -----------------------------------------
// stop
//else // Reconnect mode is on, restart macro
//timestamp Game exited, restarting macro... -----------------------------------------
//end
//end
else
stop
end // end If ACTIVATE
End // end StopOnSwitchedWindow
Procedure Close_RFOnlineError // will restart macro if the RF_Online.bin error pop-up is found
//delay 8 sec
IsWindow RF_Online.bin // pop-up 2
MousePos 500, 313
delay 1 sec
leftclick
keys {RETURN} // close pop-up
delay 8 sec
IsWindow RF_Online.bin // pop-up 3
MousePos 500, 313
delay 1 sec
leftclick
keys {RETURN}
delay 8 sec
IsWindow RF_Online.bin // pop-up 4
MousePos 500, 313
delay 1 sec
leftclick
keys {RETURN}
delay 5 sec
else
restart // restart macro
end // end pop-up 4
else
restart
end // end pop-up 3
else // no error found
//restart
end // end pop-up 2
End
Procedure ConvertXY using RadarX, RadarY // converts Radar x,y values to Screen x,y values
Compute ScreenX = TRUNC ( ($RadarX - 690) * 10 )
Compute ScreenY = TRUNC ( ($RadarY - 40) * 6.3 )
if $ScreenX < 10
Set ScreenX = 10
end
if $ScreenY < 10
Set ScreenY = 10
end
End
Procedure Move2 using ConstX, ConstY // moves to target on radar screen given radar coordinates
// how long to hold down the move button
Compute YMOVE = 150 * ( ABS ($ConstY - 82))
Compute XMOVE = 150 * ( ABS ($ConstX - 730))
// adjustment for close targets
(*if $YMOVE < 850
set YMOVE = 300
end*)
MousePos 195, 291
MousePos 562, 279
if $YMOVE > $XMOVE // get the higher value between XMOVE and YMOVE
Set MOUSE_MOVE = $YMOVE
else
Set MOUSE_MOVE = $XMOVE
end
// get area on the screen to hold down left mouse on
Call ConvertXY $ConstX, $ConstY // sets ScreenX, ScreenY
timestamp moving to $screenX, $screenY for $mouse_move
MousePos $ScreenX, $ScreenY
delay 100
LeftMouseDown
delay $MOUSE_MOVE
LeftMouseUp
end // end move2
Procedure Check_Ammo // used in MAU Mode to see if it's time to jump off
if $MAU_Mode = 0 // exit if on foot
exit
end
IsGrey 669, 523
IsGrey 671, 524
IsGrey 675, 520
// out of ammo, jump out of MAU
MousePos 737, 539 // select MAU action bar
delay 100
Doubleclick
delay 200
Doubleclick
Loop 8
MousePos 766, 542
doubleclick
delay 500
doubleclick
delay 500
End
//KeyDown h 200
Set MAU_Mode = 0
End
End
End
End
Procedure Press_Slam Every 30 sec // only in buff_mode
if $Buff_Mode = 1
// Slam key - reset buffs
keydown {F10} 50
keydown {F10} 50
keydown {F10} 50
keydown {F10} 50
keydown {F10} 50
end
End
Procedure Check_Dead
(* IsGrey 88, 21
IsGrey 89, 23
IsGrey 88,19
IsGrey 88, 24
// dead, stopping macro
stop
End
End
End
End*)
End
// END OF MACRO
(************************************************* *********************************************
AUTHOR'S NOTES:
Special procedures added to ACTool 5.3.0 sourcecode:
- SearchRadar n1,n2
Sets {LastX},{LastY} to the coordinates of the nearest yellow dot on the radar, 0,0 if not found
n1 = pixel range for green dot(player) checking
n2 = pixel range from center for player checking
- MiddleClick
- MWheelUp
- MWheelDown
- SaveGlobalScreen
- ReleaseGlobalScreen
- InitFlag
************************************************** *********************************************)
[quote][b]
(************************************************* ******************************************
Map.mac - Contains variables and procedures used in path-finding
on the RF Online map screen (800x600 resolution)
************************************************** ******************************************)
Include E:\Downloads\Bot Collection\Fully AUTO all RF Bot (In Development)\pathfile.mac // routines for getting path coordinates from file
DataSet digits // dataset for Number objects
fld1 = string 20 // object name: Number_0 to Number_9
fld2 = string 1 // value of the number object: 0-9
end
DataSet Path // contains the list of waypoints the bot will traverse on combat patrol
fld1 = string 4 // X coordinate
fld2 = string 4 // Y coordinate
end
Constructs // lists
//list1 = list
end
Constants
Char = 0 // character found by Check_Number, can be '0'-'9' or 'E' (invalid character)
Walk_Delay = 4 // how long to walk (in seconds)
NumX = 0 // The X coordinate on the map screen, set to 'Error' if object not found
NumY = 0 // The Y coordinate
wayX = 0 // current target waypoint coordinates
wayY = 0
List_Count = 0
object_tries = 5 // # of loops
object_delay = 40 // delay between loops
end
Procedure GetXcoord using xc1, yc1, xc2, yc2
Call Check_Number $xc1, $yc1 // 1st digit
if $Char <> E
compute NumX = $Char * 10
else
Set NumX = Error
exit
end
Call Check_Number $xc2, $yc2 // 2nd digit
if $Char <> E
compute NumX = $NumX + $Char
else
Set NumX = Error
exit
end
end // end GetXcoord
Procedure GetYcoord using xc1, yc1, xc2, yc2
Call Check_Number $xc1, $yc1 // 1st digit
if $Char <> E
compute NumY = $Char * 10
else
Set NumY = Error
exit
end
Call Check_Number $xc2, $yc2 // 2nd digit
if $Char <> E
compute NumY = $NumY + $Char
else
Set NumY = Error
exit
end
end // end GetYcoord
Procedure Check_Number using xloc, yloc // checks for a number object at location x,y
DSFirst digits
while 1=1 // loop through digits
if EOF digits
exit
end
//timestamp testing for number digits[fld2]...
loop $object_tries
IsObject digits[fld1] at $xloc, $yloc
//timestamp NUMBER digits[fld2] FOUND >>>>>>>>>>>>>>>>>>>>
Set Char = digits[fld2]
exit
else
Set Char = 4
//timestamp NOT FOUND >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end
delay $object_delay
end // loop tries
DSNext digits
end // end while 1=1
End
Procedure AddDigit using Field1, Field2 // add an element to the digits dataset
DSAppend digits
SetConst digits[fld1] = $Field1
SetConst digits[fld2] = $Field2
DSPost digits
end
Procedure Init_Digits
// populate digits dataset with number object info (These objects must be defined in Objects.mac)
DSEmpty digits // clear dataset
call AddDigit Number_0, 0
call AddDigit Number_1, 1
call AddDigit Number_2, 2
call AddDigit Number_4, 4
call AddDigit Number_6, 6
call AddDigit Number_7, 7
call AddDigit Number_8, 8
call AddDigit Number_9, 9
call addDigit Number_5, 5
call AddDigit Number_3, 3
end
Procedure Display_Digits // loop through dataset and output contents
DSFirst digits
//timestamp DISPLAYING CONTENTS OF DIGITS---------------------------------------
while 1=1
if EOF digits // end of dataset, break from loop
break
end
//timestamp digits[fld1], digits[fld2]
DSNext digits
end
//timestamp END DISPLAY --------------------------------------------------------
end
Procedure DisplayXY // display current map coordinates
if $numX = Error or $NumY = Error
//timestamp map error
else
//timestamp Current map coordinates: X = $NumX, Y = $NumY
end
end
Procedure AddPath using xloc, yloc // add an element to the digits dataset
DSAppend Path
SetConst Path[fld1] = $xloc
SetConst Path[fld2] = $yloc
DSPost Path
end
Procedure InitPath using code // loads the waypoint list using a code, which is the map grid name
// ex) A1, U9, S20...
DSEmpty Path // clear dataset
CASE $code
WHEN T11 // Bellato Main Base- Crawler Bunch / Grumble
call AddPath 69,64
call AddPath 71,67
WHEN G20 // Bellato Anacaade Settlement - Hu Gaff, Crook, Crawler Axle/Maul
call AddPath 51,76
call AddPath 54,74
WHEN N16 // Accretia - south of outpost, Grumble/Lizard
call AddPath 55,68
call AddPath 58,64
WHEN P15 // Accretia - south of outpost, Grumble/Lizard
call AddPath 66,62
call AddPath 65,69
WHEN G1 // Accretia - Snatcher Shrine, Grumble Hook Ace
call AddPath 79,67
End // end CASE
//DSFirst Path // get coordinates for first waypoint
Set wayX = Path[fld1]
Set wayY = Path[fld2]
End
Procedure DisplayPath // loop through dataset and output contents
DSFirst Path
timestamp DISPLAYING CONTENTS OF PATH-----------------------------------------
while 1=1
if EOF Path // end of dataset, break from loop
break
end
timestamp Path[fld1], Path[fld2]
DSNext Path
end
timestamp END DISPLAY --------------------------------------------------------
end
Procedure GetNextWaypoint // sets wayX and wayY to the coordinates of the next waypoint in the Path
DSCount Path, $List_Count
//timestamp count = $List_Count
if $List_Count = 0 // error, no items in the Path dataset
Set wayX = 0
Set wayY = 0
exit
end
DSNext Path
if EOF Path
DSFirst Path
end
Set wayX = Path[fld1]
Set wayY = Path[fld2]
End
Procedure DisplayWaypoint // display current target waypoint
if $wayX = 0 and $wayY = 0
timestamp waypoint error
else
timestamp Current waypoint: X = $wayX, Y = $wayY
end
end
Procedure InitializeMap // Initialize number objects and waypoints
timestamp INITIALIZE MAP-------------------------------------------------------- // debug
Call Init_Digits
Call Display_Digits // debug
//call InitPath G1 // init Path for map grid G20
call GetPathFromFile // read coordinates from file (populates the FPath dataset)
DSCopy FPath, Path // copy FPath to Path dataset
Set wayX = Path[fld1]
Set wayY = Path[fld2]
call DisplayPath // debug
timestamp ---------------------------------------------------------------------- // debug
End
Procedure MapMove // get position on map, compare to target waypoint, align view to North, move
// get current position on map (NumX, NumY)
delay 1 sec
keydown m 100 // bring up map screen
Call GetXcoord 217,88,224,88 // get the X,Y coordinates in the upper-left of the map screen
Call GetYcoord 245,88,252,88 // First 2 numbers are coordinates of 1st digit,
// last 2 numbers are for the 2nd digit
//delay 500
keydown m 100 // close map screen
Call DisplayXY // debug
if $NumX = 0 and $NumY = 0 // check if coordinates are valid
timestamp Map ERROR - exiting procedure...
exit
end
StrTrim $NumX
StrTrim $NumY
StrTrim $WayX
StrTrim $WayY
// compare current position to target waypoint
if $NumX = $WayX and $NumY = $WayY // current position = waypoint
timestamp waypoint $WayX, $WayY reached, getting next waypoint... // debug
Call GetNextWaypoint // bot has reached its target, get next waypoint
//Call getnextwaypoint
end
Call DisplayWayPoint // debug
if $WayX = 0 and $WayY = 0 // check if coordinates are valid
timestamp Waypoint ERROR - exiting procedure...
exit
end
//Call FaceNorth&