ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: valen2.0 on August 21, 2016, 03:59:45 PM
-
I am trying to make a script that will cast curse weapon. But I also want it to implement a buffbar scanner. Either Twinkle McNugget or ens. Would anyone be able to help me?
-
I am trying to make a script that will cast curse weapon. But I also want it to implement a buffbar scanner. Either douchebags or ens. Would anyone be able to help me?
We don't post/use the name of the Scripty on this site. He burned alot of people here via many methods, needless to say he left a major sour taste in everyones mouth.
But you are more than welcome to use the original and still the best Buffbar scanner. It just so happens i posted a new beta version of script... http://www.scriptuo.com/index.php?topic=1508.msg114465#msg114465
Download those follow setup instructions in first post (basically put files in same directory as easyuo.exe)
Then your custom script could be something like this...
repeat
call scanbuffbar
if _CurseWeapon_ notin %BuffBarIconNames
{
; code to caste curse weapon
}
until #charghost = yes
-
Sorry for using his name I did not know that. And I will try this and also give feed back as well if you would like as you stated it was beta.
-
Sorry for using his name I did not know that. And I will try this and also give feed back as well if you would like as you stated it was beta.
The latest version is a beta version inbetween version ... as I made alot of changes between version 40 and 41. But its not a true beta as the script is many many years old. I think I started writting the buffbar scanner back in 2003/4 when the buffbar was initially introduced into UO and everyone said it couldn't be done... so its well over a decade old. :) That said yes please let me know if you have any difficulties.
-
Also thank you for the code. I do appreciate it. What I had looked nothing like this lol. I'm not too good at this language it seems.
-
Also thank you for the code. I do appreciate it. What I had looked nothing like this lol. I'm not too good at this language it seems.
Na if you look at the history of this script on Easyuo you will see it has been through an excess of 41 iterations/versions many unreleased. Each time the code gets reduced and the scanning speed increases. The first version was 100% readable like a book as time went on it has gottens less and less readable as I utilize what ever tricks i can muster to gain speed. The first version would take one second plus to read the bar .. now its averaging 1-2ms !!!
-
ok so i have redownloaded the new files EN, but when I run this it doesn't appear to can the bar. I just waits about 10 seconds and recasts. The files are all in the same directory. Am i not implementing the file correctly? Or am I missing it locating the icon itself?
repeat
call scanbuffbar
if _CurseWeapon_ notin %BuffBarIconNames
{
event macro 15 104
wait 5
}
until #charghost = yes
-
ok simple test to make sure its finding the the code.
Open buffbar .. Have at least one icon on it .. (any icon) run below code... and post up what it tells you.
call scanbuffbar
display ok BAR Direction: %BuffbarDirection $ Icons Found: %BuffBarIconsFound $ Icon Names: %BuffBarIconNames
halt
-
Bar direction: right
Icons Found: 4
Icon Names: enchanted summoning, poison resistance,lightning strike , and vampiric embrace.
So it scans the bar.
Post Merge: August 23, 2016, 08:35:05 AM
is an else statement missing inside the loop?
-
Umm caste Curseweapon on yourself and then run the test see if it detects it... or not ?
-
It detects it. I had like 7 icons and it showed them all.
Post Merge: August 23, 2016, 09:25:12 AM
I double checked the spelling just invade there was a conflict there. It was the same. Is the notin function not working properly?
-
It detects it. I had like 7 icons and it showed them all.
Post Merge: August 23, 2016, 08:25:12 AM
I double checked the spelling just invade there was a conflict there. It was the same. Is the notin function not working properly?
Well lets try different logic.. if not ( blabla in blabla )
if ! ( _CurseWeapon in %BuffBarIconNames )
{ ; code to caste curseweapon }
Make sure the %BuffbarIconNames showes CurseWeapon as _CurseWeapon ... with the _ infront...
-
OK I will double check that after I finish running errands. It's my day off lol.
Post Merge: August 23, 2016, 04:55:29 PM
hmm it still doesn't work. It always recasts it around 10 seconds in.
-
I double checked the spelling just invade there was a conflict there. It was the same.
What did you mean by above please post the exact code from your script cut and paste. Its going to be something silly.
-
I meant just incase there was a spelling error. I looked to make sure that in the code the variable wasn't spelled different.
The current code is
repeat
call scanbuffbar
if ! ( _CurseWeapon in %BuffBarIconNames )
{
event macro 15 104
wait 5
}
until #charghost = yes
-
try this
repeat
call scanbuffbar
if _CurseWeapon_ in %BuffBarIconNames
{
event macro 15 104
wait 5
}
until #charghost = yes
-
Ok, so
repeat
call scanbuffbar
if _CurseWeapon_ in %BuffBarIconNames
{
event macro 15 104
wait 5
}
until #charghost = yes
doesn't cast the spell at all. So the scanner is obviously working. Why wouldn't the previous code work?
-
Ok, so I have tried to place call scanbuffbar in the code in different places and even call it more than once to see if for some reason it wasn't updating correctly. Like it overwrote the variable maybe? still nothing. it still casts every 10 seconds or so.
-
Ok, so I have tried to place call scanbuffbar in the code in different places and even call it more than once to see if for some reason it wasn't updating correctly. Like it overwrote the variable maybe? still nothing. it still casts every 10 seconds or so.
Ok I am going to have to create a char on test center to get to the bottom of this.
-
Figured it out... My Mistake... it no other icons on Bar curseweapon is being returned as CurseWeapon_ not _CurseWeapon_
Will include fix in next release.. but you can fix yourself edit line 40 of scanbuffbar.txt change "set %BuffBarIconNames" to "set %BuffBarIconNames _"
repeat
call scanbuffbar
if _CurseWeapon_ notin %BuffBarIconNames
{
event macro 15 104
; below waits are to give time for spell to finish casting and buff to load so dont repeat try to caste.
wait 5
While #charstatus = A ; casting spell
wait 1
wait 2 ; time needed for buff to be added
}
until #charghost =yes
Halt
As i predicted it was something silly.
-
FYI,
Rebirth have no icon for Curse weapon.
-
IT WORKS! also i did find a little hiccup haha. If you have your pointer over the bar it bugs out the scanner it seems and it will either spam cast or cast every couple seconds.
-
IT WORKS! also i did find a little hiccup haha. If you have your pointer over the bar it bugs out the scanner it seems and it will either spam cast or cast every couple seconds.
yes i you cover specific icons but not other spots on buffbar script not be able to read all icons... Only way to eliminate that is much more scanning... The next version will have a few additional checks for exactly that. Life is sometimes a compromise, In order to completely 100% know the length of the bar I would have to refresh it every time. But that would be annoying, the bar constantly reopening and thus blinking on your screen My original version way back when did that and it was annoying. So Place your bar in out of way spot not likely to get accidentally covered.
The bar is read via pixel scanning in EUO their is no way to do it otherwise.. in stealth you can read the gump in memory and thus is 100% accurate 100% Of the time and faster. As long as you take reasonable precautions my buffbar scanner will be 100% accurate as well.