Author Topic: Multi client targeting  (Read 9103 times)

0 Members and 1 Guest are viewing this topic.

Offline tandj99Topic starter

  • Elite
  • *
  • *
  • Posts: 261
  • Activity:
    0%
  • Reputation Power: 1
  • tandj99 has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Multi client targeting
« on: January 13, 2017, 09:48:24 AM »
0
Looking for a simple shared target for my tamers   So when im on my main account i can say all kill my will attack and then the other follow suit as of right now i cant seem to get it to work .I know im missing something some where Little Point in right direction.

this is what i have  If yall know a better way let me know thx

;=========== MAINCODE =============
sub main
while #true
{
  onhotkey F9
    gosub TargetCursor
  onhotkey F11
    gosub attack
}
return
;==================================
sub TargetCursor
event macro 13 1
target 20
until #targcurs = 1
set #ltargetid #findid
set #ltargetkind 1
event macro 22 0
}
wait 20
uoxl swap
}
return
;==================================

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Multi client targeting
« Reply #1 on: January 13, 2017, 11:03:21 AM »
0


Code: [Select]
sub TargetCursor
event macro 13 1
target 20
until #targcurs = 1

Need a repeat or the Until #Targcurs = 1 line does nothing.

Code: [Select]
Sub TargetCursor
Repeat
event macro 13 1
target 20
until #targcurs = 1

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline tandj99Topic starter

  • Elite
  • *
  • *
  • Posts: 261
  • Activity:
    0%
  • Reputation Power: 1
  • tandj99 has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Multi client targeting
« Reply #2 on: January 13, 2017, 12:09:55 PM »
0
Ok with the repeat it is bring up cursors now. thank you   But when i hit the hot key for attack i see the other Client saying all kill but the pet is not attacking ?
Am i missing something. Is there a way to write it where Only the curse target from char a will share over to char b  .. So far this is kinda working just im missing something ive looked over a few attack scripts and just not finding what i am missing  :-[
onhotkey F9
    gosub TargetCursor
  onhotkey F10
    gosub attack
}
return

;==================================
sub TargetCursor
msg All kill$
repeat
until #targcurs = 1
set #ltargetid #findid
set #ltargetkind 1
event macro 22 0
}
wait 20
uoxl swap
}
return
;==================================
sub attack
msg All Kill$
 wait 5
 event macro 22 0
 }
return

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #3 on: January 13, 2017, 12:12:31 PM »
+1
That wait 20 you have in there is not very efficient for multi client scripting. Since you're swapping, there's no real need to wait after the attack, just set a timer for that client, which is about the speed you can attack at on multiple clients, and swap, and when you return to that client, check the timer to see if it's up again, and you're able to attack. The whole time, checking for spawn, and monsters you can attack with your pet. Including people. I wrote this very quickly, but it should constantly update your target with either the monster your clients are attacking, or once that monster is dead, it will attack a new monster. Not sure it works, haven't tested, but it's close. To be complete, you probably should set your #ltargetkind also. I'm just a noob and always forget to do that until it messes up.

Code: [Select]
set %targets ;Put target types here
set %range 10
for %i 1 #cliCnt
{
  set %attackTimer . #charid #systime
  set %targetFoundTimer . #charid #systime
}
repeat
    set %targetFound n/a
    set %target1 n/a
    finditem %targets g_ , %range
    if #findcnt > 0
    {
      for #findindex 1 #findcnt
      {  
        if #findid = %target
        {
          if %targetFoundTimer . #charid < #sysTime
            set %targetFoundTimer . #charid #systime + 10000
          set %targetFound #findid
          break
        }
        set %target1 #findid
      }
    }
    if %target1 <> n/a
      set %target %target1
    if %targetFound <> n/a
      set %target %targetFound
    else
      set %targetFoundTimer . #charid #sysTime - 1
  for %i 1 #clicnt
  {
    if %target <> n/a && %attackTimer . #charid < #systime && %targetFoundTimer . #charid < #systime
      gosub attackTarget
    uoxl swap
  }
until #false

sub attackTarget
  msg $all kill$
  set #ltargetid %target
  target 1s
  event macro 22
  if %targetFound <> n/a && %targetFoundTimer . #charid < #systime
    set %targetFoundTimer . #charid #systime + 10000
  set %attackTimer . #charid #systime + 1000
return
« Last Edit: January 13, 2017, 12:22:11 PM by BobOzarius »

Offline tandj99Topic starter

  • Elite
  • *
  • *
  • Posts: 261
  • Activity:
    0%
  • Reputation Power: 1
  • tandj99 has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Multi client targeting
« Reply #4 on: January 13, 2017, 01:00:43 PM »
0
thXS bob  Ill see what i can do with that  .I honestly I like the hot key function myself.. That way i dont have to set just one type and have to change it all the time.

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #5 on: January 13, 2017, 02:13:33 PM »
0
Why set one type? Why not put all types in it?  You can put in decision making to determine what to attack based on whatever you like. I like everything to be auto. There's no reason you can't add a target and auto button. Auto ON. Auto OFF. Target ON. Target OFF. The %targets variable can hold more than one type. Put in 100 types. The way I wrote this, it should attack a monster every second, unless the monster is still there when the attack timer is up, then it should set a timer for 10 seconds, but keep checking if the same monster is still there, and only reattack every 10 seconds, and if it dies, then it will refind another monster to attack. Or should anyways. That was the plan when I started writing it. And it should attack on all your open clients.
« Last Edit: January 13, 2017, 03:38:34 PM by BobOzarius »

Offline tandj99Topic starter

  • Elite
  • *
  • *
  • Posts: 261
  • Activity:
    0%
  • Reputation Power: 1
  • tandj99 has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Multi client targeting
« Reply #6 on: January 13, 2017, 02:18:57 PM »
0
true Ive tried this ... i  need the hot key one cause i run with a tamer with luck and the rest without and i need my main to do most damage  so i could say all kill then after 1 min tell the others on hot key too kill

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #7 on: January 13, 2017, 03:39:31 PM »
0
So on a new monster, set a timer to have the #clinr of that client attack first, and set a timer to have the other clients attack 10 seconds after or something.  Should be very easy to do.

if #charid = %characterWithLuck && %attacktimer . #charid < #sysTime && %targetfound = #false... or something similar. Then have that character attack, and set a however many second timer you want to keep the other clients from attacking until that timer is up and the same monster is still found.  Shouldn't be too difficult. Then it will only attack with multiple clients if the monster lives long enough too. Tons of ways to do it easily.
« Last Edit: January 13, 2017, 03:42:34 PM by BobOzarius »

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: Multi client targeting
« Reply #8 on: January 13, 2017, 04:18:12 PM »
0
You guy love the client swap,  let me suggest other option, call namespace Global.   With this you can pass any king of information inside the same EasyUO. 

here something you can read http://www.scriptuo.com/index.php?topic=1130.0   to help you out. 

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #9 on: January 13, 2017, 06:55:07 PM »
0
Please show me an example of global namespace that is faster than the swapping code above and does the same thing. I'd like to see it if you have one.

You guy love the client swap,  let me suggest other option, call namespace Global.   With this you can pass any king of information inside the same EasyUO. 

here something you can read http://www.scriptuo.com/index.php?topic=1130.0   to help you out. 

Offline gruntman

  • Full Member
  • ***
  • Posts: 168
  • Activity:
    0%
  • Reputation Power: 2
  • gruntman has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #10 on: January 14, 2017, 07:50:07 PM »
0
Please show me an example of global namespace that is faster than the swapping code above and does the same thing. I'd like to see it if you have one.

You guy love the client swap,  let me suggest other option, call namespace Global.   With this you can pass any king of information inside the same EasyUO. 

here something you can read http://www.scriptuo.com/index.php?topic=1130.0   to help you out. 

Have a look at the link Ghost provided..It will give you your peek into how it works.

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #11 on: January 14, 2017, 10:18:33 PM »
0
     Maybe I wasn't clear. I'd like to see an example because I'm very sure namespace isn't going to be the best option in this situation. Gbot won't show me anything new I don't know about namespaces. Assuming that Ghost thinks uoxl swap is a bad idea, then he must be saying that using multiple scripts with global namespaces, on each individual client, is a better option. I don't agree. Namespaces are a bit slow at transferring data. But if he can show me an example that proves his point, that applies to the original posters needs, I'll be happy to check it out and see if he's right. The op did ask for help. I can rewrite it with globals and multiple scripts if you'd like to compare. But I was hoping Ghost would prove his point with some code. For the benefit of the original poster.

     Say you have 5 accounts, and you're using one account to transfer info to each of the other 4 accounts with namespace globals, there is a slight pause in the transfer of data to the global namespace, and when other scripts in other tabs can read it that isn't present when you swap. Swapping is very speedy. And when you set a standard variable in easyuo, it's available immediately to any other client that you swap to, no namespace "lag." I think it all depends on the number of clients too, because there is a slight lag between the time it takes to swap between the first client and back around to the first client. If you're using 10 clients, namespace might be better. 6 or under? Swap is the way to go. If  you look at the example I posted, you'll see why it's a better option I think. Also it assumes he's moving the clients around manually using 1 mouse and each separately. Using my way they'd have to stay on screen with each other. I could edit it to make that not necessary pretty easily though. Tandj wasn't too clear on what he wanted it to do. So I just threw something together. If you have a better idea with namespaces though, I'm sure tandj would appreciate seeing multiple options.

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: Multi client targeting
« Reply #12 on: January 15, 2017, 06:50:18 AM »
0
Not saying that my way is better or faster.    But when you have to pass target  and control to 3 to 5 characters the namespace global  make it easier.    I utilize  this for PvM build.  This way I only have one screen to pay attention and one menu that perform all the action.   I use the G-Bot basic function  and build what I need him to do.    If I hunt with my Sammy, tamer and  mage  or with the army ( character) all the task are pass via global.   IF this the best way to do it,  I can't tell you because I haven't try the swap client.  I learn one way and choice that road.   I can tell you that since I learn about the namespace global, it had make my life easier to multi client and kept them a life. 

 I agree with BobOzarius  that I have a slight delay in some action, but at the end,  they all come out one after an other.

Offline BobOzarius

  • Full Member
  • ***
  • Posts: 103
  • Activity:
    0%
  • Reputation Power: 2
  • BobOzarius has no influence.
  • Respect: +26
  • Referrals: 0
    • View Profile
Re: Multi client targeting
« Reply #13 on: January 15, 2017, 08:07:22 AM »
0
Until you prove it with code, it's still just your opinion that namespace is better with 3 to 5 clients. Consider this the challenge to prove it with script.  ;)  I'd like to see how you'd do it.

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: Multi client targeting
« Reply #14 on: January 15, 2017, 10:09:23 AM »
0
*somewhere in the distance, TM hears a gaunlet crash to the stone floor!*
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: