Official Nodeka Board  

Go Back   Official Nodeka Board > Nodeka > Scripting > UMC

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2009, 02:30 AM
Bellum Bellum is offline
Novice
 
Join Date: Sep 2009
Posts: 25
Default Auto Join Script

Trying to make a list of players that I will always auto join weather it is player combat or just regular npc combat.

Problem I'm having is it creates the array it adds players names to the array, but once I rescue them it takes them out of the array. I'm not the best at java so I'm looking for a little assist.

Thanks In advance.

Code:
#var autojoin 0
#script {var join_group = new Array()}

#alias {joinon} {#var autojoin 1}
#alias {joinoff} {#var autojoin 0}

#action {( %0 ) %1 is here, fighting %2.} {join_variable;#var {join_target} {$$1};#if {$join_target = $join_group} {join $join_group}}
#action {You join %0 in battle!} {addJoin $0}

#alias {addJoin} {#script join_group.push("$1")}
#alias {join_variable} {#script umc.setVar("join_group", join_group.pop())}
#alias {showJoin} {#script {umc.capture (join_group)}}



#nop -AUTO JOINS-

addJoin Meier
addJoin Apocolypse
addJoin Cashville
Reply With Quote
  #2  
Old 09-22-2009, 04:06 AM
Bellum Bellum is offline
Novice
 
Join Date: Sep 2009
Posts: 25
Default

Okay, I got it to work, if the player has no other augments in their name. If there is anything else in their name this won't work.

Code:
#var autojoin 0
#script {var join_group = new Array()}

#alias {joinon} {#var autojoin 1}
#alias {joinoff} {#var autojoin 0}

#action {( %0 ) %1 is here, fighting %2.} {join_variable;#var {join_target} {$$1};#if {$join_group contains $join_target} {join $join_target}}


#alias {addJoin} {#script join_group.push("$1")}
#alias {join_variable} {#script umc.setVar("join_group", join_group)}
#alias {showJoin} {#script {umc.capture (join_group)}}



#nop -AUTO JOINS-

addJoin Meier
addJoin Apocolypse
addJoin Cashville

Last edited by Bellum; 09-22-2009 at 04:09 AM.
Reply With Quote
  #3  
Old 09-22-2009, 11:49 AM
Odinn Odinn is offline
Hero
 
Join Date: Jan 2008
Location: Memphis
Posts: 93
Default

Try stripping out everything but the name, after all the name is in White while the rest is cyan.
__________________
Take solace in the dark, for the light brings truths untold.
Reply With Quote
  #4  
Old 09-22-2009, 03:45 PM
Bellum Bellum is offline
Novice
 
Join Date: Sep 2009
Posts: 25
Default

Quote:
Originally Posted by Odinn View Post
Try stripping out everything but the name, after all the name is in White while the rest is cyan.
Have the script act off the name only? I don't understand what you want me to do with just the name.

I have been told 3 times to base it off the color of the name. I do not know how to do that.
Reply With Quote
  #5  
Old 09-23-2009, 12:30 AM
grimm's Avatar
grimm grimm is offline
Apprentice
 
Join Date: Nov 2008
Posts: 78
Default

whoa someone stuff a cork in torments mouth. emo kid alert
________
Iolite vaporizer

Last edited by grimm; 03-10-2011 at 02:52 AM.
Reply With Quote
  #6  
Old 09-23-2009, 09:08 AM
Rar Rar is offline
Novice
 
Join Date: Jun 2008
Posts: 14
Default

They're talking about writing a response (in JScript, rather than just UMC/JMC) based on the full string including the ANSI escape sequences.

When you write an action, you're working with the plain text, but the actual text data sent to your client includes escape sequences which change the text color. There's a list at http://ascii-table.com/ansi-escape-sequences.php
Reply With Quote
  #7  
Old 09-23-2009, 06:24 PM
Serenity's Avatar
Serenity Serenity is offline
Administrator
 
Join Date: Jan 2008
Location: In your mind.
Posts: 133
Default

Rar is there wa way to see the exact line with escapes in your client?
__________________
What is now proved, was once imagined!
Reply With Quote
  #8  
Old 09-24-2009, 06:14 AM
Rar Rar is offline
Novice
 
Join Date: Jun 2008
Posts: 14
Default

Quote:
Originally Posted by Serenity View Post
Rar is there wa way to see the exact line with escapes in your client?
Sure, just cook the output and spit it back out. For example, way back when I was building my list of full strings with escape sequences, I had an #alias that was something like:

#alias {capture}{#action {%0$$0%1}{#scr showString(%0$$0%1);#unaction {%0$$0%1}}

So if I were looking for the full ANSI string for say, Caller clan chat, I could type "capture Caller:". The next time a string with "Caller:" appeared, it would send that line to the showString function.

In the showString function, I would take the string passed to it, then do a simple search and replace of ASCII #27, which is the character used to initiate an escape sequence, to something readable (e.g. "<ESC>"). Then the function would spit that string back out for viewing. Since the escape char #27 was no longer present, the string would show with the code laid out - the color codes and such are treated as plain text since there's no esc char.

(There are other concerns that pop up in practical usage - for example, you'll need to do more replaces if semicolons are your client command delimiter, since many codes are of the form <ESC>#;##m. The above is the main gist of the solution, though.)
Reply With Quote
  #9  
Old 09-24-2009, 01:56 PM
Serenity's Avatar
Serenity Serenity is offline
Administrator
 
Join Date: Jan 2008
Location: In your mind.
Posts: 133
Default

Thanks that should at least help him get the colour info to work with and might give me a few ideas too.
__________________
What is now proved, was once imagined!
Reply With Quote
  #10  
Old 09-25-2009, 05:01 AM
dreslin dreslin is offline
Novice
 
Join Date: Mar 2008
Posts: 11
Default

I know nothing about coding this stuff or anything. I know bellum uses nembot as do many of you guys. Is it possible ( or easier ) to make it into a 'profile script' of sorts via nembot versus straight jmc or umc?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:46 PM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.