Page 2 of 2

Re: Making bots aim for the head

Posted: Fri Mar 23, 2018 2:17 am
by lemeshovich
thanks for your help especially for comments in code
but my server is crashing now when bots see each other:/

Re: Making bots aim for the head

Posted: Fri Mar 23, 2018 5:05 pm
by Kami
I just tested my code and it seems to run fine on windows. Not sure why it would crash on linux, sorry :(

Re: Making bots aim for the head

Posted: Fri Mar 23, 2018 11:12 pm
by lemeshovich
i just tested on windows and its working there aswell
but i need that for linux:(
I'm not sure, but it seems to me that the problem is in random.py for linux
but thank you anyway

Re: Making bots aim for the head

Posted: Fri Mar 23, 2018 11:31 pm
by Ayuto
No, it's probably player.view_entity, which is pretty much the same like this issue:
https://github.com/Source-Python-Dev-Te ... issues/233

Re: Making bots aim for the head

Posted: Sun Mar 25, 2018 6:47 am
by lemeshovich
is there any way to avoid it?

Re: Making bots aim for the head

Posted: Sun Mar 25, 2018 9:09 am
by Ayuto
The short term solution is to change PreEvent to Event. Then bots will aim on the head on the second shot.

Re: Making bots aim for the head

Posted: Mon Mar 25, 2019 9:35 pm
by manico
Is there any way to make them aim for the head even better? Like they used to do in CS: Source?

Re: Making bots aim for the head

Posted: Fri Nov 29, 2024 1:47 pm
by son21332
Ayuto wrote:Try this (untested):

Syntax: Select all

import memory

from memory import find_binary, DataType, Convention
from memory.hooks import PostHook
from players.entity import Player
from entities.helpers import pointer_from_index

server = memory.find_binary('server', False)

PICK_AIM_SPOT = server[b'\x55\x89\xE5\x57\x56\x53\x81\xEC\x9C\x00\x00\x00\x8B\x5D\x08\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x83\x70\x5A\x00\x00'].make_function(
Convention.THISCALL,
(DataType.POINTER,),
DataType.VOID
)

@PostHook(PICK_AIM_SPOT)
def post_pick_aim_spot(args, return_value):

playerPointer = args[0]
index = playerPointer.get_ushort(23152)

if (index != -1 and index < 32):

entPointer = pointer_from_index(index)
enemy = memory.make_object(Player, entPointer)
eyeLocation = enemy.eye_location

botProfile = playerPointer.get_pointer(14484)
skillLevel = botProfile.get_float(8)

playerPointer.set_float(eyeLocation[0], 23072)
playerPointer.set_float(eyeLocation[1] - (1 - skillLevel), 23076)
playerPointer.set_float(eyeLocation[2], 23080)

I got an error like this:
Access violation while reading address '37348'.
Can you help me ?
Thank you~

Re: Making bots aim for the head

Posted: Fri Nov 29, 2024 4:59 pm
by Ayuto
On which game are you trying this? The code was made for CS:GO, which does not exist anymore.

Re: Making bots aim for the head

Posted: Fri Nov 29, 2024 5:47 pm
by son21332
Ayuto wrote:On which game are you trying this? The code was made for CS:GO, which does not exist anymore.

I tried it on CS:GO legacy.
Is there any problem with that version ?