ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Hitechs on November 22, 2016, 06:55:30 PM
-
Small script challenge:
This is a script challenge call out!
Lets see your skillz!
Rules:
- must use easyuo
- must walk to 4 spots in continues loop
- must search for corpse's at each location or while moving
- each corpse must be scanned for 3 names
- if said names not found on corpse, ignore
- if name found, walk to corpse and ignore
Ghost? you down?
-
my submission:
set %monster1 red
set %monster2 na
set %monster3 na
start:
move 331 114 1
gosub findCorpse
wait 40
move 331 128 1
gosub findCorpse
wait 40
move 316 128 1
gosub findCorpse
wait 40
move 316 113 1
gosub findCorpse
wait 40
goto start
;---------------------------
sub findCorpse
looking:
finditem yfm g_9
if #findkind <> -1
{
event property #findid
if %monster1 in #property || %monster2 in #property || %monster3 in #property
{
move #findx #findy 0
ignoreitem #findid
wait 15s
goto looking
}
else
{
ignoreitem #findid
goto looking
}
}
return
-
Might be interesting to set up challenges like this for people to come up with their own solutions. We used to do similar things back on UOCoders and WinUO. If you guys are serious about doing things like this, I can set up something like a "Scripter's Arena" on Rebirth. When we did things like this we looked for metrics like:
1) Code size
2) Execution speed
3) Code sophistication
4) Robustness
So if you guys want to brainstorm some ideas, we can see what we can do to automate an area.
-
I like lots of options and being able to change everything easy. It requires a flat surface at the moment but can be changed pretty easily. The rules weren't very clear! So I was like ???
set %monster1 Name?
set %monster2 Name?
set %monster3 Name?
set %walkTime 2000
set %searchRadius 10
set %corpse yfm
set %tileMove 4
set %x1 #charposx
set %y1 #charposy
set %z1 #charposz
set %x2 %x1 - %tileMove
set %y2 %y1
set %x3 %x1 - %tileMove
set %y3 %y1 + %tileMove
set %x4 %x1
set %y4 %y1 + %tileMove
repeat
for %i 1 4
{
repeat
event pathfind %x . %i %y . %i %z1 ; Needs journal scan for can't get there.
set %walkTimer #sysTime + %walkTime
while ( #charposx <> %x . %i || #charposy <> %y . %i ) && %walkTimer > #sysTime
{
}
until #charposx = %x . %i && #charposy = %y . %i && #charposz = %z1
finditem %corpse g_ , %searchRadius
{
if #findcnt > 0
{
for #findindex 1 #findcnt
{
event property #findid
if %monster1 in #property || %monster2 in #property || %monster3 in #property
{
repeat
event pathfind #findx #findy #findz ; Needs journal scan for can't get there.
set %walkTimer #sysTime + %walkTime
while ( #charposx <> #findx || #findy <> #charposy ) && %walkTimer > #sysTime
{
}
until #charposx = #findx && #charposy = #findy
ignoreitem #findid
repeat
event pathfind %x . %i %y . %i %z1 ; Needs journal scan for can't get there.
set %walkTimer #sysTime + %walkTime
while ( #charposx <> %x . %i || #charposy <> %y . %i ) && %walkTimer > #sysTime
{
}
until #charposx = %x . %i && #charposy = %y . %i && #charposz = %z1
}
}
}
}
}
until #false
-
ScriptWars - if you can't win you're not ready to join the elite(yet)!
It would be fun to have a challenge with a basic set of tasks to complete but not know what curveball is thrown in when you go to run it. Example: the script challenge calls for running towards a chest, opening it and picking the right item but when you go to run it the chest had been locked down, raised to the 2nd floor and unlocked so it floats up there. You can't open it while up there but you can drop it to your feet and then open it. Thinking about what could go wrong drives you to make better code!
I love challenges like that. Heck all of the coding I've learned and done has been a challenge since I SEE what elite's are doing and I wanna too!
edit: or it can be a more practical challenge, like sorting out all these bod types that sneakily don't tell you what craft they are for in the #property(not counting the actual item). Basically work to finish a type of script that is missing from the script library for non-elites. I dunno, just throwing out ideas.
-
Yes I'm down!
here my submission
Set %monster1 killer
Set %monster2 zombie
Set %monster3 na
set %corpseID YFM
set %Loc_x1 6404
set %Loc_y1 2682
set %Loc_x2 6404
set %Loc_y2 2674
set %Loc_x3 6413
set %Loc_y3 2674
set %Loc_x4 6413
set %Loc_y4 2682
while #true
{
repeat
for %TG 1 4
{
gosub Move2Loc %Loc_x . %TG %Loc_y . %TG
wait 20
goSub FindCorpse
}
}
Sub FindCorpse
finditem %corpseID G_6
if #findkind = -1
return
if #findkind = 1
{
Event Property #Findid
if ( %monster1 in #Property || %monster2 in #Property || %monster3 in #Property )
{
set %corpse #FindID
event sysmessage matching Found Ignore
repeat
event PathFind #FindX #FindY ; Moves to the corpse
until ( #charposx = #FindX && #charposy = #FindY )
wait 10
ignoreitem %corpse
return
}
event sysmessage Not matching Ingnore
ignoreitem #FindID
}
Return
sub Move2Loc
repeat
set %safety_timer ( #scnt + 20 )
event pathfind %1 %2
wait 10
until ( #charposx = %1 && #charposy = %2 ) || ( #scnt >= %safety_timer )
return
-
(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR8s3SyUGg-RDUZzGy7hVGR9XST2IeYKEIWCxAdwpR_saM4ufJtrQ)
-
Might be interesting to set up challenges like this for people to come up with their own solutions. We used to do similar things back on UOCoders and WinUO. If you guys are serious about doing things like this, I can set up something like a "Scripter's Arena" on Rebirth. When we did things like this we looked for metrics like:
1) Code size
2) Execution speed
3) Code sophistication
4) Robustness
So if you guys want to brainstorm some ideas, we can see what we can do to automate an area.
We could code a Map where you cant bring items in and cant get items out but tons of monsters and such spawn for scripting challenges ^^ With prizes..
-
Maybe not great for a script arena ... But an expert dungeon ... Some secrets that can only be done with scripts is really cool ... Like clickin multiple items in a extremely fast time to open a door ... Or items that cant be seen but can be found with finditem or something maybe #property on something only a script could see to get to the next stage... Might be fun to figure out if u had hints to point u in the right direction ..
-
This is actually a pretty neat idea not only could noobs ads cybercasper join in but it can show how the pros do it but personally opinion what should be done is maybe have only one person to see them and only do it for like a week per challenge that way some of the in experience have to put some thought behind it and come up with there own. Definitely a good learn experience to do this.