CLEO Help How to become Auto Armor

CLEO related
Status
Not open for further replies.

Kelvin_One

Member
Joined
Jul 3, 2021
Messages
17
Reaction score
0
Location
Canada
Code:
{$CLEO .cs}

//-------------MAIN---------------
thread 'AUTO'


I have done Auto HP, but I changed it to Auto Armor (but it can't work) is there any expert who can help me with Auto Armor code? Thank you very much
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
I have done Auto HP, but I changed it to Auto Armor (but it can't work) is there any expert who can help me with Auto Armor code? Thank you very much
By the looks of it, you created an HP Regeneration script(regenerates 2 HP per iteration). For Armor, use these Opcodes instead:
Code:
04DD: 1@ = actor $PLAYER_ACTOR armour // Gets My Actor's Armour
035F: actor $PLAYER_ACTOR armour += 2 // Increase My Armour by 2
 

Kelvin_One

Member
Joined
Jul 3, 2021
Messages
17
Reaction score
0
Location
Canada
By the looks of it, you created an HP Regeneration script(regenerates 2 HP per iteration). For Armor, use these Opcodes instead:
Code:
04DD: 1@ = actor $PLAYER_ACTOR armour // Gets My Actor's Armour
035F: actor $PLAYER_ACTOR armour += 2 // Increase My Armour by 2
do you know why auto hp cycle it doesn't increase 2 hp? it only increases full hp, not 2 hp, you can test (if you have free time) this I thank you very much
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
do you know why auto hp cycle it doesn't increase 2 hp? it only increases full hp, not 2 hp, you can test (if you have free time) this I thank you very much
It is because you are iterating every 5 Millisecond:
Code:
0@ = Actor.Health($PLAYER_ACTOR)
0@ += 2
Actor.Health($PLAYER_ACTOR) = 0@
wait 5

Which in a mathematical sense:
2HP*1000ms/5ms = 400HP

It only takes 250millisecond to completely recover 100HP.

So if you want the regeneration to be slower. You just need to increase the amount of time to wait before increasing your HP, changing this line for example:
Code:
0@ = Actor.Health($PLAYER_ACTOR)
0@ += 2
Actor.Health($PLAYER_ACTOR) = 0@
wait 200 // regenerate 2HP every 200ms = 10HP per Second


In this topic's objective, do the same thing towards the armor regeneration you are planning to code. Good Luck!
 

Kelvin_One

Member
Joined
Jul 3, 2021
Messages
17
Reaction score
0
Location
Canada
Code:
// This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$CLEO .cs}

//-------------MAIN---------------
thread 'AUTO'

:AUTO_11
wait 0
1@ = Actor.Health($PLAYER_ACTOR)
0045:   1@ == 10@ // (float)
wait 5
2@ = Actor.Health($PLAYER_ACTOR)
0045:   2@ == 20@ // (float)
if
001D:   1@ > 2@ // (int)
jf @AUTO_11
wait 1000
jump @AUTO_82

:AUTO_82
wait 0
0@ = Actor.Health($PLAYER_ACTOR)
0@ += 2
Actor.Health($PLAYER_ACTOR) = 0@
wait 5
4@ = Actor.Health($PLAYER_ACTOR)
if
003B:   0@ == 4@ // (int)
jf @AUTO_11
jump @AUTO_82
@ajom With this Auto HP cleo, can bro add it function On and Off key when using cleo, thanks bro. Please help me @ajom
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
  • Type REGENH to toggle Health Regeneration
  • Type REGENA to Toggle Armour Regeneration
Code:
{$CLEO}
0000: Regeneration by AJOM

const
BOOLEANS = 31@
ENABLE_HEALTHREGEN = 0
ENABLE_ARMOURREGEN = 1
DO_WAIT = 3

REGENVALUE_HEALTH = 1 // REGENERATES 1 health every REGENDELAY
REGENVALUE_ARMOUR = 1 // REGENERATES 1 armpur every REGENDELAY
REGENDELAY = 100 // milliseconds to wait for the next regeneration to happen
end

while true
wait 0
if 0ADC: test_cheat "REGENH"
then
  if 08B7: test BOOLEANS bit ENABLE_HEALTHREGEN
  then
   08C3: clear BOOLEANS bit ENABLE_HEALTHREGEN
   0ACD: show_text_highpriority "~y~Health Regen: ~r~Disabled" time 2000
  else
   08BD: set BOOLEANS bit ENABLE_HEALTHREGEN
   0ACD: show_text_highpriority "~y~Health Regen: ~g~Enabled" time 2000
  end
else if 0ADC: test_cheat "REGENA"
then
  if 08B7: test BOOLEANS bit ENABLE_ARMOURREGEN
  then
   08C3: clear BOOLEANS bit ENABLE_ARMOURREGEN
   0ACD: show_text_highpriority "~y~Armour Regen: ~r~Disabled" time 2000
  else
   08BD: set BOOLEANS bit ENABLE_ARMOURREGEN
   0ACD: show_text_highpriority "~y~Armour Regen: ~g~Enabled" time 2000
  end
end
end

if 08B7: test BOOLEANS bit ENABLE_HEALTHREGEN
then
  0226: 0@ = actor $PLAYER_ACTOR health
  if 0@ < 100
  then
   0@ += REGENVALUE_HEALTH
   if 0@ > 100
   then 0@ = 100
   end
   0223: set_actor $PLAYER_ACTOR health_to 0@
   08BD: set BOOLEANS bit DO_WAIT
  end
end

if 08B7: test BOOLEANS bit ENABLE_ARMOURREGEN
then
  04DD: 1@ = actor $PLAYER_ACTOR armour
  if 1@ < 100
  then
   0@ = REGENVALUE_ARMOUR
   1@ += REGENVALUE_ARMOUR
   if 1@ > 100
   then
    1@ -= 100
    0062: 0@ -= 1@ // (int)
   end
   035F: actor $PLAYER_ACTOR armour += 0@
   08BD: set BOOLEANS bit DO_WAIT
  end
end

if 08B7: test BOOLEANS bit DO_WAIT
then
  wait REGENDELAY
  08C3: clear BOOLEANS bit DO_WAIT
end
end
 
Status
Not open for further replies.
Top