Author Topic: Movement Help?  (Read 2332 times)

0 Members and 1 Guest are viewing this topic.

Offline nordby21Topic starter

  • Newbie
  • *
  • Posts: 5
  • Activity:
    0%
  • Reputation Power: 1
  • nordby21 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Movement Help?
« on: January 11, 2013, 07:37:17 AM »
0
ok so im making a stealth script..or atleast tryin but im having a semi basic issue i hope

im trying to make the character move north 5 tiles then south 5 tiles

event macro 5 1 mixed with event macro 5 5...well just doesnt cut it as im sure are there any tutorials on movement and how to use your xpos ypos to make movement more fluent and simplified for me

ive also tried move..not sure what the parameters mean there but it seems to just have a constant loop of walking northwest


any advice would help this is what i have so far...please dont crucify me :/

Code: [Select]
go sub setupmove


;***************Hiding Sub***************
;----------------------------------------
sub hide
      If H notIn #charStatus
      {
      event macro 13 21
      go sub stealth
}

;----------------------------------------
;****************Movement****************
sub setupmove

    set %x1 #charposx
    set %x2 #charposy
    wait 5s
    event macro 5 1
    event macro 5 1
    event macro 5 1
    event macro 5 1
    event macro 5 1
    event macro 5 1
    wait 5s
    set %x2 #charposx
    set %y2 #charposy
    event macro 5 5
    event macro 5 5
    event macro 5 5
    event macro 5 5
    event macro 5 5
    event macro 5 5
    go sub hide
}
;----------------------------------------

i know its messed up im just trying to get movement down before i input for skill checks and a cleaner nicer looking code

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Movement Help?
« Reply #1 on: January 11, 2013, 08:10:40 AM »
0
Have you considered using event pathfind instead?

Code: [Select]
set %startX 1044 ; starting #charPosX position
set %startY 944 ; starting #charPosY position
set %endX 1048 ; ending x position
set %endY 944 ; Y position doesn't change cause I'm staying on the same plane

repeat
event pathfind %startX %startY
wait 20
event pathfind %endX %endY
wait 20
until #false

Will walk you (if your mouse is near your character) or run you (mouse away from char) from one spot to another.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Movement Help?
« Reply #2 on: January 11, 2013, 08:56:23 AM »
0
Your using subs wrong .. a sub should exit via the return command.  You call a sub via gosub not 'go sub'  ... let fix that in your code for you as an example

Code: [Select]
repeat
  gosub hide      ; first hide
  gosub stealth   ; initiailze stealthing
  gosub setupmove ; do movement
until #clilogged <> 1 ; reapeat until not logged in.
halt

;***************Hiding Sub***************
;----------------------------------------
sub hide
  If H notIn #charStatus
     {
     event macro 13 21
     }
return

sub stealth
   ; code
return

;----------------------------------------
;****************Movement****************
sub setupmove
;    set %x1 #charposx   <-- this does nothing for you
;    set %x2 #charposy
    wait 5s
    event macro 5 1
    event macro 5 1
    event macro 5 1
    event macro 5 1
    event macro 5 1
    event macro 5 1
    wait 5s
;    set %x2 #charposx
;    set %y2 #charposy
    event macro 5 5
    event macro 5 5
    event macro 5 5
    event macro 5 5
    event macro 5 5
    event macro 5 5
return
;----------------------------------------

Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Movement Help?
« Reply #3 on: January 11, 2013, 02:35:17 PM »
0
Also, Use cheffes move command when stealthing
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: