Help - Search - Members - Calendar
Full Version: Auto-Fellow (Since ELTank's is broken)
AC Tools Everything Macro > AC Tool Macros > Macro Development
sui101
EDITED:
Deleted my original post as it was not needed.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mystical Fists-Auto Fellow
New Version 1.0.0.1b
<MF-AF>
Updated 12/03/03

--CONTACT INFO--
-AC Tool Boards-
Sui101
-VN Boards-
Sui101
-Email-
Mystical_Fists2000@Yahoo.com
-In Game- (LC Only)
Mystical Fists

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Welcome to MFAF!

This script was created to help with the maintaining of fellows automaticly through the use passwords and @tell commands. It'd become apparent to me that ELTank's Auto-Fellow was becoming more and more unstable as at times it was unable to recruit, add people to a wait list, remove people from a wait list, and/or tell a person their place on the wait list from time to time. This script does all of that and more.

MFAF Features:
- Auto-detection of fellow leadership (meaning you can start this upon login or while in fellow)
- Chat screen notification of program action (Enabled/Disabled)
- Auto-Recruitment via changable passwords in @tells (default is XP)
- Auto-WaitList handling (Adding, Removing, Informing, Etc)
- WaitList listing command (you'll list everyone on the wait list in order)
- WaitList holding command (you'll halt the wait list for X minutes, great in cases of fellowers computer crashing, fellowers relogging, etc).
- I can't really think of what else it may do, lol

Most of these features are activated in @tells to you, the opperator of the script, however, some commands are used by you through chat bar commands.

These are the @tell commands currently available:
help - Gives info about MFAF and the commands available to the @teller.
password - Recruits the @teller to the fellow or adds them to the wait list (Default password is XP, but may be changed).
list - Lists the @teller's specific position in the wait list.
remove - Removes the @teller from the wait list.
waitlist - Lists off all names on the wait list in order.
hold - Halts the wait list for X minutes. This function may be turned on/off, but is always available to you with the Chat line commands (Default is off).

These are the chat line commands currently available:
/ActCmd help - Shows these commands.
/ActCmd hold - Holds the recruiting and informing of open slots in fellow for X minutes.
/ActCmd waitlist - Lists every person on the wait list in order.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***VERSION HISTORY***
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Version 1.0.0.1b
--- Fixed some code so MFAF can warn you and self-correct being Squelched by the Server
--- Fixed some code so MFAF can warn you and stop upon an @tell error
--- Fixed a bug that could cause errors with @tells
---Added some code to make implimenting fellow chat and emotes easier in the future
--- Fixed some code i left in during testing that made MFAF think that 1 person was a full fellow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Requirements
---Decal 2.6.0.1
---ACTool 4.4.15 AND Beta 5

Remember, this is a beta version. I have tried to do extensive testing with this, but it is possible there will be bugs. If you do find any, please post here or contact me with the information above. Also, if you have any other suggestion, changes, or additions, let me know as well. If this works ok, this will also be the non-beta version which I'll transfer over to the AC Tool Macros Forum.

TY!
MF smile.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you to all those that've helped:
  • Cam, OnceBitten, and Ipa (ACTool Developers)
  • All The Decal Developers
  • Ahk (TinkerBot Developer, which much of this code came from)
  • DaMOB and Triane {Coding support with MFAF}
  • Bug Testers---- Grayson/Diatribe, Therizon, Warsong of Zek, Tevoi-la, X-Magi, Dee-Mule, Flower of Dawn, Captain Schmidt, Coolio In Da Hood, Diamond Rage, Antoine, Eternal Death Mage, Bad Bowa, Chili Dawg, and Yura Freek.
DaMOB
#1 You have made an effort so you want get a RTFM from me (or worse). biggrin.gif
#2 Datasets are a bit intimidating but once you sink you teeth into them you will love them.
#3 What about the datasets have you tried and you can't figure out?
#4 Keep at it.

Here is a simple example.

Dataset WaitingList
Name = String 80
End

//DSEdit WaitingList mad.gif
DSAppend WaitingList
SetConst WaitingList[Name] = Nametobeadded
DSPost WaitingList

No need to hardcode Waitinglist but if you wish to have a maximum of 30 on a waiting list do this.

CODE
DSCount WaitingList, temp
If $temp > 30
 DirectTell $Nametobeadded, Sorry I already have 30 on my waitinglist.
Else
 //DSEdit WaitingList
 DSAppend WaitingList
 SetConst WaitingList[Name] = Nametobeadded
 DSPost WaitingList
 inc $temp
 DirectTell $Nametobeadded, You are #$temp on my waitinglist.
End
Triane
CODE
DSEdit WaitingList
DSAppend WaitingList

Okies, I like to think I know my way around DataSets, but I don't get why you're calling DSEdit then calling DSAppend? If you're appending to the set, you just call DSAppend... if you're editting a specific record in the dataset, you need to set the record somehow (DSGotoRec, DSFirst, DSLast etc) and then call DSEdit on that record. I don't understand using the two commands in sequence? AFAIK that code will perform exactly the same job if you removed the DSEdit lines... wouldn't it?

-Triane
DaMOB
No, per Cam the dataset has to be put into the edit mode or else. So, you DSEdit, DSApend, and then finalize it with a DSPost. Now, from what I gather its a Decal thing but don't quote me on that.

When Cam first told me how to use Datasets he instructed me to do it this way and I have never done otherwise.

An example would be:

DSEdit A //A is now in an edit state
SetConst A[Name] = Blah //Whatever record number we are at is being modified.
DSPost A //Save the modified A

BUT if you want to append onto the records I was instructed and if I remember right if you don't tool will gripe and crash to DSAppend.

DSEdit A //A is now in an edit state
DSAppend //A has now just had a new record added on the tail end and our current record is the new last record
SetConst A[Name] = Blah //We are changing the name field in the current record which is the last record of A
DSPost A //Save the modified A

I sort of think of DSEdit as Open and DSPost as Close. So, if you APPEND you have to open the file/dataset first then append onto it then close it. Looking at it like this it makes perfect sense (if you have done any I/O before and you have I am sure).
Triane
Hehe -- well then don't tell anyone, b/c NONE of my macros that use datasets do that and they all DSAppend properly. If that's supposed to crash AC, or ACTools, don't let my version know, b/c it hasn't done it yet!

FnB3, and BowHunter both use DSAppend extensively and although I HAVE had dataset issues vis-a-vis LoadDecalWorldEx, I've never experienced adverse affects (or even incorrect results) from DSAppending sans DSEdit. Try it, see if it works for you too! biggrin.gif

My understanding from the Help was that DSAppend and DSEdit are different methods for putting the dataset into edit-mode but doing so for different purposes.

Oh, and I just looked this up in ACTools' help:
QUOTE
DSAppend
 
Description
Adds a new record into the dataset at the end.  You must call DSPost to save your changes to the record when you are done.  You can call DSCancel at any time.  This will cancel all your edits and delete the record you just inserted.
 
 
Parameters
Dataset
 
 
Example
DataSet items
  Fld1 = String 50
  Fld2 = String 50
End
 
constant
  sList=0
end
 
procedure AddDS using Field1, Field2
  DSAppend items
  SetConst items[Fld1] = $Field1
  SetConst items[Fld2] = $Field2
  DSPost items
end
 
procedure EditDS using Field1, Field2
  DSEdit items
  SetConst items[Fld1] = $Field1
  SetConst items[Fld2] = $Field2
  DSPost items
end

Note that in AddDS DSAppend is called without DSEdit and in EditDS DSEdit is called alone.

Was the info from Cam in the forums? I don't think I caught it if it was.. I'm just curious b/c I've never done it that way...

-Triane
Ipa
DSInsert, DSAppend and DSEdit all put the dataset into Edit mode. I don't know if there is any problem with calling DSEdit before DSAppend or DSInsert, both may work without error.
I know there was an error in incStacker.mac, due to calling DSEdit before DSDelete (trying to delete a record that was in uncommitted Edit mode).

DaMOB
Cool something changed since Cam told me so now I can go delete all my fooking dual instances although this new way just looks stupid but each to their own.

Glad it works for you Triane but Cam told me this back in the older forums when I first asked how to use them. As I said oh, well.

Edit: only had about 4 or 5 instances of dsedit/dsappend so out dsedit went and I hope it works. The rest are dsedit go do lots of things and dsappend etc... so those I didn't touch. Every millisec counts imo. mad.gif
sui101
Thanks for all the replies guys. I decided to take a crack at DataSets and it seems to be working so far. Also sampled some code from Ahk's TinkerBot macro, so it's helpin a ton as well. Changed all messaging over to the ChatHandler that was built into TinkerBot, so that I don't fork up coding for multiple people @telling me. Just found out that Companion can also track the amount of members in fellow, so I can continue coding for when to recruit someone from the list if the fellow's full.

Not really that much new, just giving a heads up if anyone's wondering about where I went too, hehe. smile.gif

EDIT: Didn't really care if there was a cap or not on the wait list, it's just that before I decided to use DataSets, I knew I'd have to have a constant for each person's name on the wait list. With DataSets, it'll automaticly handle their name and number, so this should work smile.gif
sui101
Ok, came a long ways from that first rendition I gave, but still not ready to fully release what I've got. Just looking for a suggestion or sample of how to decrease a value in a DataSet. Here's a short clip of what I'm working with.

CODE

// This line is necessary to select the proper window
SetActiveWindow Asheron's Call
Constants
 LastTellName = 0
 LastTellText = 0
 Number = 0
 List = 0
End

DataSet WaitingList
 Character = String 50
 Number = String 80
End

Procedure AddToWaitingList Using Name, Number
 DSAppend WaitingList
 SetConst WaitingList[Character] = $Name
 SetConst WaitingList[Number] = $Number
 DSPost WaitingList
End

Procedure RemoveFromWaitingList
 DSLocate WaitingList, Character, $LastTellName
 DSDelete WaitingList
End

Procedure ChatHandler Every 1 Sec
 FindNextText Tell,
 SetConst LastTellName = {PluginResultAdd}
 SetConst LastTellText = {PluginResult}
 If $LastTellText = xp
   DSLocate WaitingList, Character, $LastTellName
   If WaitingList[Number] =
   // This adds a person to wait list with list position number since they weren't in the DataSet
     DSCount WaitingList, $Number
     Compute Number = $Number + 1
     Call AddToWaitingList $LastTellName, $Number
     DirectTell $LastTellName, <Auto-Fellow> You have been added to the wait list.
   Else
     // This tells a person they're already on the wait list since they were in the DataSet
     DirectTell $LastTellName, <Auto-Fellow> You are already on the wait list. WaitingList[Character]- WaitingList[Number]
   End
 Else
   If $LastTellText = List
     DSLocate WaitingList, Character, $LastTellName
     If WaitingList[Number] =
       // This tells them they don't have a position since they weren't in the DataSet
       DirectTell $LastTellName, <Auto-Fellow> You are not on the wait list.
     Else
       // This tells them their position ([number]) since they were in the DataSet
       DirectTell $LastTellName, <Auto-Fellow> You are currently #WaitingList[Number]
     End
   Else
     If $LastTellText = remove
       DSLocate WaitingList, Character, $LastTellName
       If WaitingList[Number] =
         // This tells them they weren't in the list since they weren't in the DataSet
         DirectTell $LastTellName, <Auto-Fellow> You are not on the wait list.
       Else
         // This removes removes the person and number from the DataSet
         Call RemoveFromWaitingList
         DirectTell $LastTellName, <Auto-Fellow> You have been removed from the wait list.
       End
     End
   End
 End
End

FindTextClear Tell
FindText Tell,
While 1=1
 ProcessMessages
 Delay 1 Sec
End


Now this is definatly just a quicky version of what I've got so far. In fact, this is a copy of the Sample.Mac I've been running just to test different syntax and try to figure out DataSet commands. What I'm wondering is if I can get ACTool to reduce the WaitingList[Number] for every WaitingList[Character]. Why might I want this? Well if I recruit someone off the waiting list, it'd be nice to tell person number 2 he's next, hehe. Now that I think about it, if the previous isn't possible or is too difficult, would it be possible for me to Inc $Number each time I add someone to the list, and then Recruit $RecruitNumber, Inc $RecruitNumber? I'd still be able to find the current amount of people on the list with DSCount, but I'd just continue to increase the RecruitNumber (which relates to the WaitingList[Number]) each time I recruit someone. I don't know... it's 3:21am here, and I'm running dry, LoL. Thanks for any help, be back tomarrow to check up.
Ahk
The easiest way I can think of to keep the list correct is to remove people (person at the top [DSFirst]) as they're added and then just @tell the new person at the top.

IE...
CODE
DSFirst WaitingList
Call Recruit WaitingList[Character]
//If not recruited keep them and try to recruit the next person...Ie. not in the area, or however you want it to work.  Make sure people will get removed if they wander off...you could try /telling them warning that they'll be removed from the list if they don't drop by very soon.
//if successful..
DSDelete WaitingList
DSFirst WaitingList     //<- probably isn't necessary but we'll do it anyways
DirectTell WaitingList[Character], You're next in line!

You didn't provide a recruit procedure so that's still kinda open ended to work on.
sui101
CODE

Procedure WaitList
 If _FellowCount >= 1
   DSLocate WaitingList, Character, $LastTellPerson
   If WaitingList[Number] =
     DSCount WaitingList, $Number
     Compute Number = $Number + 1
     Call AddToWaitingList $LastTellPerson, $Number
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You have been added to the wait list.  #WaitingList[Number]- WaitingList[Character]

     Call AddTellQue $LastTellPerson, <Auto-Fellow> You will be informed when your spot is open.  You will then have $RecruitTime to @tell me,, $Password

     Call AddTellQue $LastTellPerson, <Auto-Fellow> To see your position on the list,, @tell me,, list.  To remove yourself from the list,, @tell me,, remove.

   Else
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You are already on the list!  #WaitingList[Number]- WaitingList[Character]

   End
   Exit
 End
 DSLocate WaitingList, Number, 1
 If WaitingList[Character] = $LastTellPerson
   Call Recruit
 Else
   If WaitingList[Number] =
     Call Recruit
   Else
     DSLocate WaitingList, Character, $LastTellPerson
     If WaitingList[Number] =
       DSCount WaitingList, $Number
       Compute Number = $Number + 1
       Call AddToWaitingList $LastTellPerson, $Number
       Call AddTellQue $LastTellPerson, <Auto-Fellow> You have been added to the wait list.  #WaitingList[Number]- WaitingList[Character]

       Call AddTellQue $LastTellPerson, <Auto-Fellow> You will be informed when your spot is open.  You will then have $RecruitTime to @tell me,, $Password

       Call AddTellQue $LastTellPerson, <Auto-Fellow> To see your position on the list,, @tell me,, list.  To remove yourself from the list,, @tell me,, remove.

     Else
       Call AddTellQue $LastTellPerson, <Auto-Fellow> You are already on the list!  #WaitingList[Number]- WaitingList[Character]

     End
   End
 End
End
/////////////////////////////////////////////////////
Procedure Recruit
 SetConst CheckDistance = $LastTellPerson
 Call CheckDistance
 If _selected <> $LastTellPerson
   Exit
 End
 Call AddTellQue $LastTellPerson, <Auto-Fellow> Attempting to recruit you now!
 Call ChatHandler
 Call CheckChatState
 Keys {F12}
 Call CheckChatState
 Keys {F4}
 WaitForCursor
 MousePos $FellowshipRecruit
 FindTextClear Server
 FindTextClear Message
 FindText Message,
 While {PluginResult} = TEXT NOT FOUND
   If _Selected <> $LastTellPerson
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You are not close enough at this time.
     Exit
   End
   WaitForCursor
   Call MouseClick
   WaitForCursor
   FindNextText Message, is not accepting Fellowship requests.
   If {PluginResult} <> TEXT NOT FOUND
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You are not accepting fellowship requests.

     Exit
   End
   FindNextText Message, is not close enough to your level.
   If {PluginResult} <> TEXT NOT FOUND
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You are not close enough to my level.

     Exit
   End
   FindNextText Message, is too far away.
   If {PluginResult} <> TEXT NOT FOUND
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You are not close enough at this time

     Exit
   End
   FindNextText Message, is already a member of a Fellowship.
   If {PluginResult} <> TEXT NOT FOUND
     Call AddTellQue $LastTellPerson, <Auto-Fellow> You are already in a fellowship.

     Exit
   End
   FindNextText Message, is now a member of your Fellowship.
 End
End


Recruit is called from the WaitingList, but doesn't have any code yet for announcing the slot is open. But I think you're right on about using DSFirst, hadn't thought of it. What I'm wondering though is if someone @Tell's me to find their current position in line, how would I tell them what their position is if it's gone down? Don't want the guy who's 2nd after 4hrs to continue to think he's 6th, etc.


Code- If you're wondering about the constants, don't worry, the code I posted in the post before this one was from the sample and were the only constants I needed. This is from the current version, and everything works to here.

EDIT: GD Wrap around really blows, lol. The spaces you see do not exist in the script, they're just placed there for easier reading.
Ahk
If you get an @tell from someone asking their position, then just do a DSLocate on their name.
...
CODE

DSLocate WaitingList, Character, $LastTellPerson
If EOF WaitingList
  Call AddTellQue $LastTellPerson, Sorry,, but you are not on the list.
Else
  DSRecNo WaitingList, $SomeTempVar       //use some temporary variable
  SetConst SomeTempVar = You are + + # + $SomeTempVar in line.
  Call AddTellQue $LastTellPerson, $SomeTempVar
End


That should work unless I made a typo somewhere, logic looks to be sound.

Ahk
sui101
Wow, thanks a ton Ahk!! That's awsome. You're example also showed me some other code that I could clean up:

Replace
CODE

DSLocate WaitingList, Character, $LastTellPerson
  If WaitingList[Number] =


With
CODE

DSLocate WaitingList, Character, $LastTellPerson
If EOF WaitingList


Looks much cleaner like that!! Thanks for the help duder, and thanks again for the go-ahead on using the message/chat handler from TinkerBot. I prolly will never think of anything to help improve it, but it's a damn fine piece of code to handling the @tells smile.gif

EDITED: Full Version Posted At Top Now smile.gif
sui101
Mystical Fists-Auto Fellow
<MF-AF>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***VERSION HISTORY***
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Version 1.0.0.0b
---This is the first version!
---WTF do you think is new?!?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Info on first post at top of page 1 smile.gif


I've got this posted on the vnboards as well, and already have 1 suggestion, that I was actually working on, but couldn't find a way to do it. I want to add an @tell command and chat line command that would allow people to add names to the wait list, even if they're not that person. Also, I wanted to add a chat line command to remove people (not an @tell command for fear of abuse by haters, lol).

This is the kind of code I was thinking of if anyone wants to take a look and give a suggestion or two:

CODE

Procedure Remove on ActCmd remove Using Name
 DSFirst WaitingList
 If WaitingList[Character] = $Name
   DSDelete WaitingList
   Call AddTellQue $Name, <MF-AF> You have been removed from the wait list.
   DSFirst WaitingList
   If EOF WaitingList
   Else
     Call AddTellQue WaitingList[Character], <MF-AF> You are now next on the waiting list.
   End
 Else
   DSLocate WaitingList, Character, $Name
   If EOF WaitingList
     Call AddTellQue $Name, <MF-AF> You are not currently on the list.
   Else
     DSDelete WaitingList
     Call AddTellQue $Name, <MF-AF> You have been removed from the wait list.
   End
 End
End

Procedure Add on ActCmd add Using Name
 DSLocate WaitingList, Character, $Name
 If EOF WaitingList
   Call AddToWaitingList $Name,
   DSLocate WaitingList, Character, $Name
   DSRecNo WaitingList, $Number
   SetConst Number = <MF-AF> You have been added to the wait list. + + # + $Number WaitingList[Character]
   Call AddTellQue $Name, $Number
   Call AddTellQue $Name, <MF-AF> You will be informed when your spot is open.  You will then have $RecruitTime minutes to @tell me,, $Password
   Call AddTellQue $Name, <MF-AF> To see your position on the list,, @tell me,, list.  To remove yourself from the list,, @tell me,, remove.
 Else
   DSRecNo WaitingList, $Number
   SetConst Number = <MF-AF> You are already on the list! + + # + $Number WaitingList[Character]
   Call AddTellQue $Name, $Number
 End
End


I haven't a clue wether or not there's a way to make this work, but it's worth a shot to ask. Also, I had been racking my brain for hours trying to figure out a way to do this in @tells (possibly as a work around for adding/removing people by @telling yourself), so if there's any suggestion on that, that'd be killer.

Thanks for all the help people, guess I pushed this out a tad fast, lol smile.gif
Ahk
Can't mix them up, I've asked that very question myself in the past smile.gif

It can only be ActCmd or Using, but not both.
You can /tell yourself -- I used to do it on TinkerBot to summon portals for people who don't bother asking the portal bot that is standing right there and just spam hey anyone got this portal for 5 minutes...<uh rant off>.

Despite the fact that you can't use both, you can probably get away with using {ActCmdParam}, and splitting it up into individual parts (somewhat difficult process), and then use it to do what you want...

Ie
Procedure Test On ActCmd test
Sendtext 3, Test was called with extra parameter {ActCmdParam} !!
End

Then do this is AC:
/actcmd test hey this is my extra, parameters, that have to be split!
...or whatever you care to blurb into it hehe.
Splitting it up can be difficult, you'll need to use Str** commands to do that.

Gluck
Ahk
sui101
Mystical Fists-Auto Fellow
New Version 1.0.0.1b
Updated 12/03/03

-Version 1.0.0.1b
--- Fixed some code so MFAF can warn you and self-correct being Squelched by the Server
--- Fixed some code so MFAF can warn you and stop upon an @tell error
--- Fixed a bug that could cause errors with @tells
---Added some code to make implimenting fellow chat and emotes easier in the future
--- Fixed some code i left in during testing that made MFAF think that 1 person was a full fellow

Updated script is located at the bottom of the first post
dirty elf
i am looking for these files

does anyone have them, or another solution for an automatic fellow plugin?
Bear
QUOTE(dirty elf @ Apr 8 2009, 07:28 AM) *
i am looking for these files

does anyone have them, or another solution for an automatic fellow plugin?

Nothing like replying to a Thread thats SIX YEARS DEAD!!!

The Site was hacked around 4 years ago so any files where lost. but the Threads were able to be restored (Without the Files).
dirty elf
6 years and still looking, sad i know sad.gif


oh well worth a shot right?
B D O C
Yeah, having something like this would be very useful. Maybe we can come up with one using the info in this post and this forum.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.