Author Topic: Trying to wrap my brain around the infamous STR command  (Read 2077 times)

0 Members and 1 Guest are viewing this topic.

Offline alaskanTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Activity:
    0%
  • Reputation Power: 1
  • alaskan has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Trying to wrap my brain around the infamous STR command
« on: September 18, 2014, 10:54:54 PM »
0
Not trying to step on any toes with this post and just in advanced I do use/love TM's CLAW script, one of the best looting scripts I've seen. For myself though I'm trying to get better with EUO in general and it seems I've still much to learn lol. Which brings me to this topic. I somewhat understand strings and how powerful they can be when used properly, especially in looting purposes. I've taken this sub that I found on the EUO website and tailored it a little for learning purposes. I've tested this sub and it works superb for evaluating the "sum" of the pre-sub variables (%1 %2 %3 etc. not sure if that's the correct terminology lol). I'm trying to only evaluate the intensity of one item for looting vs. the intensity sum of all the items. I will post this "modified" sub (credit was given where credit is due) and if someone wishes to see the full script I have no problem posting it. I just want to understand using the str command fully. Any and all help is much appreciated  :D.

Code: [Select]
gosub getprop blah blah blah
sub getprop

  ;This sub was written by JackD. I merely added modifications
  ;
  ;

  namespace push
  namespace local getprop
  set !0 %0
  set !1 %1
  set !2 %2
  set !3 %3
  if !0 > 0 && !1 <> N/A
  {
    finditem * C_ , %1 ; corpse from my script
    if #findcnt < 1
      return %total
    set !oldlpc #LPC
    set #LPC 10000
    set %total 0
    set !line % . !0               
    goto L , !0
L5:                                      ; Assuming this part stores blah and stores it into the string
    set !line !4 , #spc , !line
L4:
    set !line !3 , #spc , !line
L3:
    set !line !2 , #spc , !line
L2:
    set !line !1 , #spc , !line
L1:
    set !line $ , !line , #spc
    str len !line
    set %len #strRes
    for #findindex 1 #findcnt
    {
      event property #findid
      if !line in #property
      {
        str pos #property !line
        set %pos #strRes + %len
        str mid #property %pos 5
        set %prop #strRes
        str pos %prop $
        set %pos #strRes - 1
        str left %prop %pos
        set %tempval #strRes
        str pos %tempval %
        if #strRes > 1
        {
          set %pos #strRes - 1
          str left %tempval %pos
          set %tempval #strRes
        }
        set %total %total + %tempval           ; I believe this tallies up all the integers for blah
      }
    }
    set #LPC %oldlpc
    namespace clear
    namespace pop
    return %total
  }
  namespace clear
  namespace pop
return 0
"You miss 100% of the shots you don't take" - Wayne Gretzky

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • 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: Trying to wrap my brain around the infamous STR command
« Reply #1 on: September 19, 2014, 07:46:59 AM »
0
The string explanation in their wiki and help sections over at EUO are pretty good.  That's where I learned...
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline alaskanTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Activity:
    0%
  • Reputation Power: 1
  • alaskan has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Trying to wrap my brain around the infamous STR command
« Reply #2 on: September 19, 2014, 10:35:19 AM »
0
Aye, lol guess I'll look over their tutorials a couple more times  :)
"You miss 100% of the shots you don't take" - Wayne Gretzky

Tags: