Author Topic: Questions about dot and such  (Read 8681 times)

0 Members and 1 Guest are viewing this topic.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Questions about dot and such
« on: March 08, 2011, 10:37:04 AM »
0
I want to cycle through all the clients I have opened and set variables for the different chars health.

I don't really get conconcatconating(?) so.....

Code: [Select]
for %1 1 #cliCnt ; should cycle the number of clients that are opened?
{
uoxl swap
set %char #charID . #hits ; would this return XXYYZZ11 where XXYYZZ is #charID and 11 is his HP's?
}

And if I wanted more info.... would this work?

Code: [Select]
for %1 1 #cliCnt ; should cycle the number of clients that are opened?
{
uoxl swap
set %char #charID . #hits . #charStatus ; would this return XXYYZZ11&& where XXYYZZ is #charID and 11 is his HP's and && is Status?
}

And *if* that's right, then how do I deal with the variable later to get stuff "out" of it?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • 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: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Questions about dot and such
« Reply #1 on: March 08, 2011, 11:24:18 AM »
0
You might want to do it something like this:

Code: [Select]
for %index 1 #cliCnt
{
  uoxl swap
  set %charid . %index #CHARID
  set %charhits . %index #HITS
  set %charstatus . %index #CHARSTATUS
}

That way you don't have to parse anything and just look at %charid1, %charhits1, etc.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Questions about dot and such
« Reply #2 on: March 08, 2011, 11:39:25 AM »
0
I had thought about that also, but wasn't sure if it could be done that way.

But I was kind of right on the {dot} thing?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • 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: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Questions about dot and such
« Reply #3 on: March 08, 2011, 11:44:59 AM »
0
I think it would have had unwanted effects.  If you are using #hits as your index, and suppose you are down hitpoints, once you get back around to checking, the hitpoints would have changed and you'd loose your reference.  If you index with just the integer as it counts through your clients online, then you'll always reference the information you need, and won't have to parse it further.

I guess you could do something like this if you want to parse it:

Code: [Select]
for %index 1 #cliCnt
{
  uoxl swap
  set %charinfo . %index #CHARID , _ , #HITS , _ , #CHARSTATUS
}

Then you can just search for "_" and break it up.  I wouldn't recommend that since if you don't need to parse, then why bother?

I've found it annoying with EUO to use nested "dot" operators since the precedence can mess up what you "think" the results should be.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Questions about dot and such
« Reply #4 on: March 08, 2011, 11:49:47 AM »
0
Ahh... kk...

My goal was going to be a check of all clients and do a ( #hits / #maxHits * 100 ) to determine percentage, then have a healer cast on whoever has the lowest percentage.

So each cycle would have something like

Cure if anyone needs it
Heal the lowest percentage

The thinking is that it wouldn't be busy trying to heal a char who's just down like 10 points where there is a char who is down 50 points.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • 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: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Questions about dot and such
« Reply #5 on: March 08, 2011, 12:05:55 PM »
0
That's real easy then, you don't even have to record the information.  Just scan through the clients and do the calculation.  Make a note of the lowest percentage, and the associated %index value.  If something is lower, then replace the percentage and index.  At the end, you should have the lowest percentage and the associated index to heal.  Easy peasy.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Questions about dot and such
« Reply #6 on: March 08, 2011, 12:19:24 PM »
0
Easy peasy.  ;)

Uhm... yeah... not so much for some of us.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • 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: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Questions about dot and such
« Reply #7 on: March 08, 2011, 12:27:49 PM »
0
Heh; no idea if this will work, since I don't multi client very much.  But it gives you an idea.
Code: [Select]
set %lowest_index N/A
set %lowest_percentage 100
set %threshold 90
for %index 1 #cliCnt
{
  set #CLINR %index
  set %percentage #hits * 100 / #maxhits
  if %percentage < %lowest_percentage
  {
    set %lowest_percentage %percentage
    set %lowest_index %index
  }
}

if %lowest_index <> N/A && %lowest_index < %threshold
{
  set #CLINR %lowest_index
;  heal me!!
}
« Last Edit: March 08, 2011, 12:29:31 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Questions about dot and such
« Reply #8 on: March 08, 2011, 12:30:16 PM »
0
I'll play with that one.... see what it does.

I might have gotten about half of that right, and that's the half already done in previous posts lol.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Scrripty

  • Guest
Re: Questions about dot and such
« Reply #9 on: March 08, 2011, 12:30:25 PM »
0
This is what I did.  I was trying to demonstrate using your needs tho.  I would have done it like TM otherwise.  Not sure if this works, but you get the idea.

Code: [Select]
set %percentToHeal 70
set %currentHeal 0
for %reset 1 #clicnt
  set % . %reset 0
for %i 1 #clicnt
{
  set % . #clinr ( ( #hits / #maxhits ) * 100 )
  if %i = 1 && % . #clinr < %percentToHeal
    set %currentHeal #clinr
  if %i >= 2
  {
    if % . #clinr < % . #clinr - 1 && % . #clinr < %percentToHeal
      set %currentHeal #clinr
  }
  uoxl swap
}
set %healThisPerson 0
for %healCheck 1 #clicnt
{
  if %healCheck = 1 && % . #clinr > 0
    set %healThisPerson %healCheck
  if %healCheck >= 2 && % . %healCheck < % . %healcheck - 1
    set %healThisPerson %healCheck
}

CAST HEAL ON %HEALTHISPERSON HERE.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Questions about dot and such
« Reply #10 on: March 08, 2011, 12:32:07 PM »
0
Yes, different code to compare!

Seriously, I like seeing stuff done different way so I can learn the differences and see how stuff actually works. Thanks.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Scrripty

  • Guest
Re: Questions about dot and such
« Reply #11 on: March 08, 2011, 12:40:20 PM »
0
Yes, different code to compare!

Seriously, I like seeing stuff done different way so I can learn the differences and see how stuff actually works. Thanks.

I'm not sure if you can set #clinr and swap that way, if you can, you must have to be logged into all clients to swap to each one, cause you can't do it with one logged in and one not. :)  Not sure why.  Probly a better idea to use uoxl swap cause you CAN swap to that client if one logs out or something, then you could run a relog routine.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • 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: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Questions about dot and such
« Reply #12 on: March 08, 2011, 12:47:59 PM »
0
Ya, it's been a LONG time since I did any client swapping.  I remember there was some black art with it.  But you can see from the flow what the intentions are.  Twinkle McNugget certainly has the recent experience on the swapping, so I'd definitely take his advice.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: Questions about dot and such
« Reply #13 on: March 08, 2011, 12:53:06 PM »
0
Ya, it's been a LONG time since I did any client swapping.  I remember there was some black art with it.  But you can see from the flow what the intentions are.  Twinkle McNugget certainly has the recent experience on the swapping, so I'd definitely take his advice.

Your way makes the script continue easily if a client drops tho I believe.  So if you just up and lost a client, your way would be preferable... you could actually write a swapper in such a way that the #clinr way would add and subtract clients on the fly as you loaded them.  I haven't played with it, but thinking about it it sounds like a great way to do it.  Client swapping has been known to crash here and there so having a way to recover gracefully is probly preferable to swapping to a dead client.  But if you do clinr and a client logs, your script gets stuck.  Unless you do if #clilogged = 0, uoxl swap.  That would recover from a logged not dropped client using your way probly?  Just thinking out loud.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Questions about dot and such
« Reply #14 on: March 08, 2011, 01:26:51 PM »
0
See that last part actually makes sense to me... if the #clilogged is 0 then don't try anything there and go to the next one.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Tags: