Log in

View Full Version : Keep Distance Mod



xstojakes
03-26-2016, 16:43
Hello i maked a simple, little bit bugged Keep Distance function in VB6 code. Char goin ~3 sqms before target.

ModCavebot after


Public setFollowTarget() As Boolean

put this:


Public setDistance() As Boolean

after


Case "setnofollow"
setFollowTarget(Sid) = False
'exeLine(Sid) = exeLine(Sid) + 1
updateExeLine Sid, 1, True
fastM = True

put this:


Case "setdistance"
setDistance(Sid) = True
'exeLine(Sid) = exeLine(Sid) + 1
updateExeLine Sid, 1, True
fastM = True

ModCavebot after End if:

If bestMelee = True Then
aRes = MeleeAttack(idConnection, bestID)
End If
If setFollowTarget(idConnection) = True Then
PerformMove idConnection, myX(idConnection) + bestX, myY(idConnection) + bestY, myZ(idConnection)
End If
paste this:

If setDistance(idConnection) = True Then

If myX(idConnection) < bestX & myY(idConnection) < bestY Then
Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX - 4, myY(idConnection) + bestY - 4, myZ(idConnection)
End Select


ElseIf myX(idConnection) > bestX & myY(idConnection) > bestY Then

Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX + 4, myY(idConnection) + bestY + 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) > bestX & myY(idConnection) < bestY Then

Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX + 4, myY(idConnection) + bestY - 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) < bestX & myY(idConnection) > bestY Then

Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX - 4, myY(idConnection) + bestY + 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) <> bestX & myY(idConnection) = bestY Then
Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX, myY(idConnection) + bestY + 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) = bestX & myY(idConnection) <> bestY Then
Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX + 4, myY(idConnection) + bestY, myZ(idConnection)
End Select
End If

End If
frmMain after


setFollowTarget(i) = False

paste this:


setDistance(i) = True


after:


setFollowTarget(index) = False

paste this


setDistance(index) = True


after


ReDim setFollowTarget(1 To MAXCLIENTS)

paste it


ReDim setDistance(1 To MAXCLIENTS)


frmCavebot after


setFollowTarget(idConnection) = True

put this:


setDistance(idConnection) = False


Now when you type line SetDistance in cavebot your character will be run from target.

oclipper
03-27-2016, 04:35
very nice. i still using blackd on tibia rl

Beggari
03-27-2016, 16:26
Oh, that's really nice. Try posting on github to see if Daniel merges it.

If he does, I'll get you some cash on Unitera, if you want.

xstojakes
03-27-2016, 17:48
Nono(I playing on Astera,Rowana,Secura), it is little bit bugged, and i maked this script for my usage too:D.I'll fix it when ill have some more time, i working in this same time at this small freezes when cavebot changing a waypoint, somewhere must be a wait delay configured to doin that. And idk why cavebot dont check some monsters corpse when you using a fluid after killing a mob, it should use fluid->check a corpse. Bot don't doin that, WHY? I think, when Daniel fix this bugs, we will destroy this capitalistic Xenobot etc, and Blackd will be lightninig on pantheon of best Tibia bots EVER!

Hans Henrik
06-11-2016, 14:32
good job! sure has been times in the past where i'd need something to keep distance, but never actually wrote any code for it :D

blackd
06-14-2016, 16:59
Looks really nice. Thank you!
Now it would be great if someone can test it and post the changes to our github so I can merge it directly.
https://github.com/blackdtools/Blackd-Proxy-CLASSIC/

carlaobot
08-31-2016, 06:19
Hello i maked a simple, little bit bugged Keep Distance function in VB6 code. Char goin ~3 sqms before target.

ModCavebot after


Public setFollowTarget() As Boolean

put this:


Public setDistance() As Boolean

after


Case "setnofollow"
setFollowTarget(Sid) = False
'exeLine(Sid) = exeLine(Sid) + 1
updateExeLine Sid, 1, True
fastM = True

put this:


Case "setdistance"
setDistance(Sid) = True
'exeLine(Sid) = exeLine(Sid) + 1
updateExeLine Sid, 1, True
fastM = True

ModCavebot after End if:

If bestMelee = True Then
aRes = MeleeAttack(idConnection, bestID)
End If
If setFollowTarget(idConnection) = True Then
PerformMove idConnection, myX(idConnection) + bestX, myY(idConnection) + bestY, myZ(idConnection)
End If
paste this:

If setDistance(idConnection) = True Then

If myX(idConnection) < bestX & myY(idConnection) < bestY Then
Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX - 4, myY(idConnection) + bestY - 4, myZ(idConnection)
End Select


ElseIf myX(idConnection) > bestX & myY(idConnection) > bestY Then

Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX + 4, myY(idConnection) + bestY + 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) > bestX & myY(idConnection) < bestY Then

Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX + 4, myY(idConnection) + bestY - 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) < bestX & myY(idConnection) > bestY Then

Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX - 4, myY(idConnection) + bestY + 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) <> bestX & myY(idConnection) = bestY Then
Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX, myY(idConnection) + bestY + 4, myZ(idConnection)
End Select
ElseIf myX(idConnection) = bestX & myY(idConnection) <> bestY Then
Select Case CInt(Int((1 * Rnd()) + 1))
Case 1
PerformMove idConnection, myX(idConnection) + bestX + 4, myY(idConnection) + bestY, myZ(idConnection)
End Select
End If

End If
frmMain after


setFollowTarget(i) = False

paste this:


setDistance(i) = True


after:


setFollowTarget(index) = False

paste this


setDistance(index) = True


after


ReDim setFollowTarget(1 To MAXCLIENTS)

paste it


ReDim setDistance(1 To MAXCLIENTS)


frmCavebot after


setFollowTarget(idConnection) = True

put this:


setDistance(idConnection) = False


Now when you type line SetDistance in cavebot your character will be run from target.

Really nice what u did!

I need to just understand where i should write this codes... suppose to be on CaveBot area?

Lucyoro
05-30-2019, 13:01
You have to keep the all mod of distance that have the data among to have some friction on this that was able to good. I have to make report on this so I need to know are essay writing services ethical? (https://essaysoriginreview.com/faq/) This was the details that I need to gat among these fields on this.