I was wondering if there is a way to enable or disable the wander function via keypress within a waypoint file without having to use del and end keys to pause and resume the script?
Update...
Nevermind. I think i figured it out. All I have to do to make it stop "wandering" is, because my wandering was set to radius of 0 anyways, is to disable the skills when the key is pressed, then if I want it to "wander" again at a different key press, then I just re-enable those skills. I'll test it tonight.
Enable/disable Wander via keypress?
Re: Enable/disable Wander via keypress?
use a xbox wireless joystick and you can carry it around and press button anywhere.
-
- Posts: 36
- Joined: Mon Jun 01, 2015 7:44 am
Re: Enable/disable Wander via keypress?
I am using this little functions in one of my scripts to start/stop wandering, but I didnt figured out, how to activate/deactivate it via keypress
Code: Select all
function startWander ()
settings.profile.friends = {"Bubsitan"} -- don't attack this mob
settings.profile.mobs = {"Jungb\132r"} -- farm mobs
changeProfileOption ("PATH_TYPE", 'wander')
changeProfileOption ("WANDER_RADIUS", 50)
changeProfileOption ("MAX_TARGET_DIST", 350)
__WPL:setForcedWaypointType ('NORMAL')
end
function stopWander ()
settings.profile.mobs = {"nobody"}
changeProfileOption ("PATH_TYPE", 'waypoints')
changeProfileOption ("WANDER_RADIUS", 0)
changeProfileOption ("MAX_TARGET_DIST", 0)
__WPL:setForcedWaypointType ('TRAVEL')
end
I am a botter, but no cheater. So none of my scripts ever use any of the hacks like swimhack, speedhack, wallhack...
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time
-
- Posts: 527
- Joined: Fri Aug 31, 2012 1:15 pm
Re: Enable/disable Wander via keypress?
You can try it like this. I took this function I use for turning on and off speed and changed it up with your start/stop wandering functions included. With this it should start or stop wandering each time you hit the "g" key. If you want to change which key it uses, just change the key.VK_G on line 36 to whichever key you want to use.
This is untested, by the way.
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad><![CDATA[
WanderEnabled = false
function startWander ()
settings.profile.friends = {"Bubsitan"} -- don't attack this mob
settings.profile.mobs = {"Jungb\132r"} -- farm mobs
changeProfileOption ("PATH_TYPE", 'wander')
changeProfileOption ("WANDER_RADIUS", 50)
changeProfileOption ("MAX_TARGET_DIST", 350)
__WPL:setForcedWaypointType ('NORMAL')
end
function stopWander ()
settings.profile.mobs = {"nobody"}
changeProfileOption ("PATH_TYPE", 'waypoints')
changeProfileOption ("WANDER_RADIUS", 0)
changeProfileOption ("MAX_TARGET_DIST", 0)
__WPL:setForcedWaypointType ('TRAVEL')
end
--============= Function to show button controls ===================
function SKM_ShowButtons()
if WanderEnabled then
cprintf(cli.green, "G - - > Disable Wandering!!!\n")
else
cprintf(cli.green, "G - - > Enable Wandering.\n")
end
end
--============= main routine starting: =====================
local delay = 1 -- time between key presses.
local time = os.time()
SKM_ShowButtons();
while(true) do
if keyPressed(key.VK_G) and (os.time() - time > delay ) then
if WanderEnabled then
WanderEnabled = false
stopWander()
cprintf(cli.yellow, "Wandering Disabled!!!\n")
else
WanderEnabled = true
startWander()
cprintf(cli.green, "Wandering Enabled!!!\n")
end
time = os.time()
end
yrest(50)
end
]]></onLoad>
</waypoints>
Who is online
Users browsing this forum: Bing [Bot] and 4 guests