I need help from the expert scripters out there. I'm trying to improve my bandage script and I made a small change to it. After I made that small change, I started blowing through 2,000 bandages in a few seconds fighting a Halloween shadow boss. Before I know it i wasted 12k bandages and die. Below is the original script and below that is the new version. What did I do wrong?
function Auto_Heal_Bandages_three()
{
var Timer, Msg = "You put the bloody bandage|failed";
while (!Player.Dead() && Orion.Count("bandage"))
{
if (Player.Hits() < 425)//Player.MaxHits() - 1) //change this if you want to heal at a different HP level.
{
Orion.ClearJournal(Msg);
Orion.BandageSelf();
Timer = Orion.Now();
while (!Orion.InJournal(Msg) && Orion.Now() < Timer)
{
Orion.Wait(1);
}
}
else
{
Orion.Wait(1);
}
}
}
New script (I highlighted the change)
function Auto_Heal_Bandages_three()
{
var Timer, Msg = "You put the bloody bandage|failed";
while (!Player.Dead() && Orion.Count("bandage"))
{
if (Player.Hits() < 425)//Player.MaxHits() - 1) //change this if you want to heal at a different HP level.
{
Orion.ClearJournal(Msg);
Orion.Say('[bandself');
Timer = Orion.Now();
while (!Orion.InJournal(Msg) && Orion.Now() < Timer)
{
Orion.Wait(1);
}
}
else
{
Orion.Wait(1);
}
}
}
Orion Script help
Orion Script help
Alibaster in game!!
- Wil
- Legendary Scribe
- Posts: 1227
- Joined: Mon Dec 30, 2013 1:19 pm
- Location: Seattle, WA, USA
- Contact:
Re: Orion Script help
How long is a Wait? 1 Second? 1 millisecond?
- Wil
- Legendary Scribe
- Posts: 1227
- Joined: Mon Dec 30, 2013 1:19 pm
- Location: Seattle, WA, USA
- Contact:
Re: Orion Script help
Note that it's impossible for Orion.Now() to ever be less than Timer so the while() condition always evaluates false. This means that the script as running is:
function Auto_Heal_Bandages_three()
{
var Timer, Msg = "You put the bloody bandage|failed";
while (!Player.Dead() && Orion.Count("bandage"))
{
if (Player.Hits() < 425)//Player.MaxHits() - 1) //change this if you want to heal at a different HP level.
{
Orion.ClearJournal(Msg);
Orion.Say('[bandself');
Orion.Wait(1);
}
}
- Wil
- Legendary Scribe
- Posts: 1227
- Joined: Mon Dec 30, 2013 1:19 pm
- Location: Seattle, WA, USA
- Contact:
Re: Orion Script help
Hey +C:
How about enforcing a 10ms delay between executed player inputs and a disconnect after queue depth 100 is reached? With the exception of folks making errors with Orion scripts, that should basically be impossible to reach. And the sudden disconnects upon running a script would warn Orion users that they've made a mistake with their script before the input flood can lag the server for everybody else.
Regads,
Wil
How about enforcing a 10ms delay between executed player inputs and a disconnect after queue depth 100 is reached? With the exception of folks making errors with Orion scripts, that should basically be impossible to reach. And the sudden disconnects upon running a script would warn Orion users that they've made a mistake with their script before the input flood can lag the server for everybody else.
Regads,
Wil
Re: Orion Script help
What would be a better script to use that will not lag the server? I want a fast heal but not at the expense of everyone else. Any suggestions on how to correct the scrip is appreciated. I have no idea what I'm doing. i just found something on line that worked and was trying to make a tweak.
Alibaster in game!!
Re: Orion Script help
I tried this script and it was still burning through a ton of bandages really fast. Like one battle went through 1500 bandages. Much more then before. Any idea why that would be? My HP is around 445. I adjusted it to a threshold of 415 before healing but it seems to burn through a lot of bandages fast.Wil wrote: ↑Sat Oct 07, 2023 12:30 amNote that it's impossible for Orion.Now() to ever be less than Timer so the while() condition always evaluates false. This means that the script as running is:
function Auto_Heal_Bandages_three()
{
var Timer, Msg = "You put the bloody bandage|failed";
while (!Player.Dead() && Orion.Count("bandage"))
{
if (Player.Hits() < 425)//Player.MaxHits() - 1) //change this if you want to heal at a different HP level.
{
Orion.ClearJournal(Msg);
Orion.Say('[bandself');
Orion.Wait(1);
}
}
Alibaster in game!!
- Wil
- Legendary Scribe
- Posts: 1227
- Joined: Mon Dec 30, 2013 1:19 pm
- Location: Seattle, WA, USA
- Contact:
Re: Orion Script help
Well, as you noticed the script is consuming hundreds of bandages per second. It's not even waiting to see what the last heal did before telling it to heal you again.Alibaster wrote: ↑Sat Oct 07, 2023 12:56 amWhat would be a better script to use that will not lag the server? I want a fast heal but not at the expense of everyone else. Any suggestions on how to correct the scrip is appreciated. I have no idea what I'm doing. i just found something on line that worked and was trying to make a tweak.
So, read through the script. How long have you programmed it to wait between telling the server to heal you again?
The old version used Orion.BandageSelf(); which double-clicks a bandage, -waits- for a target cursor to appear and then targets the character.
Re: Orion Script help
Thanks. The timer looks to be set for 1 millisecond. I'll work that up and find a happy medium. Thanks again for the help.
Alibaster in game!!