Jump to content
Moopler
  • 0
Sign in to follow this  
BonSalsa

Question Adding delay to script

Question

I'm having a bit of trouble adding a delay to my ghetto kami script

 

Script

Spoiler

[ENABLE]
alloc(GetMobXY,128)
alloc(MobX,4)
alloc(MobY,4)
alloc(Teleport,256)
registersymbol(MobX)
registersymbol(MobY)
label(GetMobXY_Return)
label(Return)
label(Teleport_End)

Teleport:
mov esi,[034C9F0C] // CUserLocal: 8B 3D ? ? ? ? 8B CF F3 [address inside brackets]
lea ecx,[esi+04]
mov eax,[esi+04]
mov eax,[eax+20]
call eax
test eax,eax
je Teleport_End
push [MobY]
push [MobX]
push 00
mov ecx,eax
call 00CDA380 // 55 8B EC ? ? 10 ? FF ? 10 8D ? 10 FF ? 0C 56 FF 50 40 85 C0 79 0C 68 ? ? ? ? ? ? E8 ? ? ? ? 5E [first]
jmp Return

Teleport_End:
ret

GetMobXY:
push eax
mov eax,[ecx+900] // 89 87 ? ? ? ? 8D ? ? ? ? ? 8B ? ? 89 ? ? 89 ? ? 8A
mov [MobX],eax
add [MobX], #-10
mov eax,[ecx+900+4] // OFFSET ABOVE + 0x4
mov [MobY],eax
add [MobY], #-10
pop eax

//Original
push ebp
mov ebp,esp
push -01
jmp GetMobXY_Return

0270EBE0: // CVecCtrlMob::WorkUpdateActive
//55 8B EC 6A ?? 68 ?? ?? ?? ?? 64 A1 00 00 00 00 ?? 81 ?? ?? ?? ?? ?? ?? ?? A1 ?? ?? ?? ?? 33 ?? ?? 8D ?? ?? 64 A3 00 00 00 00 8B ?? 89 ?? ?? 8B ?? FF
jmp GetMobXY
GetMobXY_Return:

0120F24E:
jmp Teleport
Return:

[DISABLE]
0270EBE0: // 55 8B EC 6A ?? 68 ?? ?? ?? ?? 64 A1 00 00 00 00 ?? 81 ?? ?? ?? ?? ?? ?? ?? A1 ?? ?? ?? ?? 33 ?? ?? 8D ?? ?? 64 A3 00 00 00 00 8B ?? 89 ?? ?? 8B ?? FF
push ebp
mov ebp,esp
push -01

0120F24E: //[some call above] 3D B8 0B 00 00 76 ? 6A
call 01225920

dealloc(GetMobXY,128)
dealloc(MobX,4)
dealloc(MobY,4)
dealloc(Teleport)
unregistersymbol(MobX)
unregistersymbol(MobY)

 

Script with delay

Spoiler

[ENABLE]
alloc(GetMobXY,128)
alloc(MobX,4)
alloc(MobY,4)
alloc(Teleport,256)
alloc(timer,4)
registersymbol(MobX)
registersymbol(MobY)
label(GetMobXY_Return)
label(Return)
label(Teleport_End)

timer:
dd 00

Teleport:
call GetTickCount
mov edx,eax
sub edx, [timer]
cmp edx,#500
jl Return
mov [timer],eax
mov esi,[034C9F0C] // CUserLocal: 8B 3D ? ? ? ? 8B CF F3 [address inside brackets]
lea ecx,[esi+04]
mov eax,[esi+04]
mov eax,[eax+20]
call eax
test eax,eax
je Teleport_End
push [MobY]
push [MobX]
push 00
mov ecx,eax
call 00CDA380 // 55 8B EC ? ? 10 ? FF ? 10 8D ? 10 FF ? 0C 56 FF 50 40 85 C0 79 0C 68 ? ? ? ? ? ? E8 ? ? ? ? 5E [first]
jmp Return

Teleport_End:
ret

GetMobXY:
push eax
mov eax,[ecx+900] // 89 87 ? ? ? ? 8D ? ? ? ? ? 8B ? ? 89 ? ? 89 ? ? 8A
mov [MobX],eax
add [MobX], #-10
mov eax,[ecx+900+4] // OFFSET ABOVE + 0x4
mov [MobY],eax
add [MobY], #-10
pop eax

//Original
push ebp
mov ebp,esp
push -01
jmp GetMobXY_Return

0270EBE0: // CVecCtrlMob::WorkUpdateActive
//55 8B EC 6A ?? 68 ?? ?? ?? ?? 64 A1 00 00 00 00 ?? 81 ?? ?? ?? ?? ?? ?? ?? A1 ?? ?? ?? ?? 33 ?? ?? 8D ?? ?? 64 A3 00 00 00 00 8B ?? 89 ?? ?? 8B ?? FF
jmp GetMobXY
GetMobXY_Return:

0120F24E:
jmp Teleport
Return:

[DISABLE]
0270EBE0: // 55 8B EC 6A ?? 68 ?? ?? ?? ?? 64 A1 00 00 00 00 ?? 81 ?? ?? ?? ?? ?? ?? ?? A1 ?? ?? ?? ?? 33 ?? ?? 8D ?? ?? 64 A3 00 00 00 00 8B ?? 89 ?? ?? 8B ?? FF
push ebp
mov ebp,esp
push -01

0120F24E: //[some call above] 3D B8 0B 00 00 76 ? 6A
call 01225920

dealloc(Teleport,256)
dealloc(GetMobXY,128)
dealloc(MobX,4)
dealloc(MobY,4)
dealloc(Teleport)
dealloc(timer,4)
unregistersymbol(MobX)
unregistersymbol(MobY)

 

For some reason the one with the delay will d/c after teleporting a few times. Any ideas?

Edited by BonSalsa

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

Teleporting isn’t stable unless you spam it at intervals of <60ms. So ideally you want it to be continuously spammed every tick, but just update the coordinates when you need to. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×