Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how i can send values to a bash script? #385

Closed
miguelshta21 opened this issue Jun 9, 2020 · 10 comments
Closed

how i can send values to a bash script? #385

miguelshta21 opened this issue Jun 9, 2020 · 10 comments

Comments

@miguelshta21
Copy link

miguelshta21 commented Jun 9, 2020

im trying to use "f1" key when life is lower than 100 for a example

addr_health="0x65b1808"
#---------------------------------------- READING -------------------------------
function read_value(){
PID="145365"
wartosc=`./readmem "$PID" $1`
echo $wartosc; }
function write_value(){
PID="145365"
./writemem $PID $1 $2; }
#---------------------------------------- POSITION ------------------------------
function get_hp(){
hp=`read_value "$addr_health"`
printf '%d' "$hp"; }
#---------------------------------------- HEALER ------------------------------
#--source `pwd`/functions.sh
spell="F1"
cooldown=1
minimum=160
sleep 2
osd_text "Autohealing ON" 5
while true
do 
health=`get_hp`
if [ "$health" -lt "$minimum" ]; then sendkey $spell; fi
sleep $cooldown
done
@12345ieee
Copy link
Member

Please format your post correctly, it's unintelligible like this.

@miguelshta21
Copy link
Author

Please format your post correctly, it's unintelligible like this.

sorry my bad

@miguelshta21
Copy link
Author

@12345ieee you have discord?

@12345ieee
Copy link
Member

The easiest way is to run scanmem in noninteractive mode, like this:

andreas@trelitri:~/Progetti/scanmem$ ./scanmem -p `pidof bash` -c'dump 55acc57cc851 4;exit' 2>/dev/null
0x55acc57cc851: 43 5F 4D 4F                                     C_MO

you can then cut out the output and do what you prefer with it.

PR #346 started introducing a nicer interface for this task, but it'll need more work to be merged.

@miguelshta21
Copy link
Author

@12345ieee well what i ask is very easy I just can't explain myself its like a macro:
https://imgur.com/a/D8fZh5c
want to capture this value and then if the values goes down over the 80% then use f11
specialy this "adress value" prom this PID

@miguelshta21
Copy link
Author

@sriemer can you help me too? :/

@12345ieee
Copy link
Member

You'll have to explain yourself better then.

Also, don't ping unrelated people.

@miguelshta21
Copy link
Author

@12345ieee sorry for the ping, to explain in the best way is:
#example my full health bar value is 180 (100% of my life points)
i want to keep capturing this value and convert it to variable if the variable value goes down over < 70% then it will heals my life points with F1
#PID= 145365
#ADRESS OF LIFE BAR= 0x65b1808

@12345ieee
Copy link
Member

Scanmem can't call arbitrary callbacks, but you can call it like I wrote above and it'll give you the memory value at that address.
You can do that in a loop and do whatever you want with the value.

@miguelshta21
Copy link
Author

well to understand better can you convert your example using my variables?
#PID= 145365
#ADRESS OF LIFE BAR= 0x65b1808
also thank you for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants