Author Topic: Small script challenge call out~!  (Read 4237 times)

0 Members and 1 Guest are viewing this topic.

Offline HitechsTopic starter

  • Full Member
  • ***
  • Posts: 116
  • Activity:
    0%
  • Reputation Power: 2
  • Hitechs has no influence.
  • Respect: +28
  • Referrals: 1
    • View Profile
Small script challenge call out~!
« on: November 22, 2016, 06:55:30 PM »
0
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?


Offline HitechsTopic starter

  • Full Member
  • ***
  • Posts: 116
  • Activity:
    0%
  • Reputation Power: 2
  • Hitechs has no influence.
  • Respect: +28
  • Referrals: 1
    • View Profile
Re: Small script challenge call out~!
« Reply #1 on: November 22, 2016, 06:56:41 PM »
0
my submission:
Code: [Select]
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

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Small script challenge call out~!
« Reply #2 on: November 22, 2016, 07:41:27 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Small script challenge call out~!
« Reply #3 on: November 22, 2016, 08:51:26 PM »
0
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 ???

Code: [Select]
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
« Last Edit: November 22, 2016, 08:59:54 PM by BobOzarius »

Offline Gemviper

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
Re: Small script challenge call out~!
« Reply #4 on: November 22, 2016, 09:30:00 PM »
0
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.
« Last Edit: November 22, 2016, 09:36:38 PM by Gemviper »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Small script challenge call out~!
« Reply #5 on: November 23, 2016, 06:41:06 PM »
0
Yes I'm down! 
here my submission

Code: [Select]
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

Offline HitechsTopic starter

  • Full Member
  • ***
  • Posts: 116
  • Activity:
    0%
  • Reputation Power: 2
  • Hitechs has no influence.
  • Respect: +28
  • Referrals: 1
    • View Profile
Re: Small script challenge call out~!
« Reply #6 on: November 23, 2016, 07:37:02 PM »
0

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Small script challenge call out~!
« Reply #7 on: November 24, 2016, 12:00:50 AM »
0
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..

Offline HitechsTopic starter

  • Full Member
  • ***
  • Posts: 116
  • Activity:
    0%
  • Reputation Power: 2
  • Hitechs has no influence.
  • Respect: +28
  • Referrals: 1
    • View Profile
Re: Small script challenge call out~!
« Reply #8 on: November 24, 2016, 07:01:16 AM »
0
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 ..

Offline cybercasper

  • Full Member
  • ***
  • Posts: 228
  • Activity:
    0%
  • Reputation Power: 3
  • cybercasper has no influence.
  • Respect: +41
  • Referrals: 1
    • View Profile
Re: Small script challenge call out~!
« Reply #9 on: November 25, 2016, 05:20:30 AM »
0
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.

Tags: