unibot.mac - Universal Robot Version1.0 RELEASED AT LAST

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

Gonezo
orc pawn
orc pawn
Posts: 10
Joined: Wed Nov 13, 2002 1:38 am

unibot.mac - Universal Robot Version1.0 RELEASED AT LAST

Post by Gonezo » Fri Nov 15, 2002 11:44 pm

Well I finally got a working UNIBOT it is not everything you ever wanted. I soon hope to make it universal right out of the package. For now it is good enough for version one.

ALL COMMANDS ARE GIVEN VIA /TELL(unless you change it)
UNIBOT WAS DESGINED FOR TELLS
verion 1.0 abilites
example-/tell <name of toon running unibot> sit
this will cause unitbot to sit
this is very customizeable macro just follow the examples that I have given you with sit and gate.

WARNING WARNING WARNING WARNING WARNING WARNING
USE THE GATE COMMAND AT YOUR OWN RISK
I HAVE HEARD OF NASTY BUGS WHEN YOU ZONE WITH AN ACTIVE MACRO
WARNING WARNING WARNING WARNING WANRING WARNING

ONTO THE CODE

Code: Select all

|** Filename: UNIBOT.mac v1.0[11-15-2002 23:35HRS EST]
Author: Gonezo
Acknowledgements[not in any order]:m0nk, Plazmaic, Rizwank, Ooak, Fippy, Wes
State: v1.0
WHAT: This is the begining of my Universal Robot macro.  I hope I finish it one day /sigh =0/
USEAGE: /macro UNIBOT.mac "master name"
**|

 |**Definitions**|
    #include spellcast.mac
    #include spellbook.mac
    #define master v99
    #chat tell
Sub Main
	/mqlog ======UniBot Activated======
	/varset master "$p0"
	|**opening commands**|
	/press CTRL 
	/press shift 
	/press alt
	
 |**Verifies to the user that they are MASTER**|
	/tell $v99 You are THE Master bro!!!

 |**Bot Sits and getpetid**|
	/sit
	/goto :getpetid
 |**This goes to the Events and starts to do them**|
	:Loop
		/if n "$spawn($id($v99),hp,pct)"<="30" {
			/target $v99 
			/call HEALNOW
			} else
		/if "$v98"=="0"
		/if "$V98"=="FALSE" /goto :skippetheal
		/if n "$spawn($v98,hp,pct)"<="30" { 
			/target "$spawn($v98)"
			/call HEALNOW
			} else
	  :skippetheal
     	  /doevents
   	/goto :Loop
 /return

|**~~~~~~~USE AT YOUR OWN RISK~~~~~~~~ 
Sub GATENOW
  	/if n $char(gem,"Gate")<1 /call MemorizeSpell gate 1
	/call cast "gate"
	/endmacro
 /return~~~~~~~~USE AT YOUR OWN RISK~~~~~**|

Sub HEALNOW
	/if n $char(gem,"Superior Healing")<1 /call MemorizeSpell "superior healing" 1
	/call cast "superior healing"
 /return



	
|~~~~~~~~~~~~~~~~~|
|  COMMANDS       |
|~~~~~~~~~~~~~~~~~|
Sub Event_Chat
	/if "$p1"=="$MASTER" {     		|Checks to see if from master then do other /if's which 
				      		|hold the bot's commands
		/if "$p2"=="sit" /sit		|commands bot to sit
		/if "$p2"=="getpetid" {		|Commands the servant to target the master in order to obtain the master's petid
		:getpetid
		/target $v99 			
		/varset v98 "$target(pet)"
		/goto :loop
		} else
	|**~~~~~~USE AT YOUR OWN RISK~~~~~~~/if "$p2"=="gate" /call GATENOW 	|commands bot to gate  ~~~USE AT YOUR OWN RISK~~~**|
 /return
	} else 
 /return
For this to run you will need to have spellbook.mac and spellcast.mac
feel free to make additions I will be working on stuff so if you want an updated copy just come to the chat room and I will DCC it to you
Thanks all and happy macroing
-Gonezo :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sat Nov 16, 2002 2:21 am

Salutations,
makes it so you can do abilities...

Code: Select all

Sub Event_Chat
   /if "$p1"=="$MASTER" {           |Checks to see if from master then do other /if's which
                        |hold the bot's commands
      /if "$p2"=="sit" {
        /sit      |commands bot to sit
       } else /if "$p2"=="getpetid" {      |Commands the servant to target the master in order to obtain the master's petid
      :getpetid
      /target $v99          
      /varset v98 "$target(pet)"
      /goto :loop
      } else /if "$p2"=="gate" {
       /call GATENOW    |commands bot to gate
      } else /if $arg(1,"$p2")=="doability" {
        /call FindLastWord "$p2"
        /varset a(3,1) $arg(2,"$p2")
    
        /if n $return!=2 {
         /for p4 3 to $return
          /varset a(3,2) $arg($p4,"$p2")
          /varset a(3,1) "$a(3,1) $a(3,2)"
         /next p4
        } 
       /doability "$a(3,1)"
     }
/return

sub FindLastWord
 /varset a(4,2) 1
 :FindLastWordloop
  /if $arg($a(4,2),"$p0")!="" {
   /varadd a(4,2) 1
   /doevents
   /goto :FindLastWordLoop
  }
/return $calc($a(4,2)-1)
now... I just stole that from another macro, and did some editting... so if it doesn't work... its my fault.

User avatar
rizwank
Huggle Police
Huggle Police
Posts: 524
Joined: Tue Jul 23, 2002 12:07 am
Contact:

Post by rizwank » Sat Nov 16, 2002 4:48 am

christ, im impressed...

gimme want list and i might code some additions.
#macroquest op
Macroquest Official Documentarion
Macroquest Board Moderator
All around cool guy

[img]http://medicomuerte.users.btopenworld.com/images/fairy_bounce08.gif[/img]

Ooka_Chokka
a lesser mummy
a lesser mummy
Posts: 63
Joined: Fri Nov 08, 2002 12:27 am

Post by Ooka_Chokka » Sat Nov 16, 2002 4:54 am

very cool , Gonezo, so dont get discouraged, all of us will do our best to help you out ( and then mooch your code, lol). Unibot=uber 8)
___________________________
Ooka Chokka lv 69 God of PoRN :twisted:
___________________________

Dirtface
a lesser mummy
a lesser mummy
Posts: 39
Joined: Tue Nov 12, 2002 2:43 am

Post by Dirtface » Sat Nov 16, 2002 6:19 am

Yeah. this bot is uber. Once its finished, Im totally adding in code for the memspells to do a level check on the bot and mem appropriate spells. Sorta like the existing druid.mac, only with a level check.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sat Nov 16, 2002 12:43 pm

Salutations,
  • char(hp)
    char(mana)
    char(level)
    char(race)
    char(class)
    char(summary)
    gem #
    haven't done adding/forgetting gems yet....
[built off my abilities code]

Code: Select all

Sub Event_Chat
   /if "$p1"=="$MASTER" {           |Checks to see if from master then do other /if's which
                        |hold the bot's commands
      /if "$p2"=="sit" {
        /sit      |commands bot to sit
       } else /if "$p2"=="getpetid" {      |Commands the servant to target the master in order to obtain the master's petid
      :getpetid
      /target $v99         
      /varset v98 "$target(pet)"
      /goto :loop
      } else /if "$p2"=="gate" {
       /call GATENOW    |commands bot to gate
      } else /if $arg(1,"$p2")=="doability" {
        /call FindLastWord "$p2"
        /varset a(3,1) $arg(2,"$p2")
   
        /if n $return!=2 {
         /for p4 3 to $return
          /varset a(3,2) $arg($p4,"$p2")
          /varset a(3,1) "$a(3,1) $a(3,2)"
         /next p4
        }
       /doability "$a(3,1)"
     } else /if "$p2"=="char(level)" {
       /delay $calc(50+$rand(100))
       /reply $char(name) is level $char(level)
     } else /if "$p2"=="char(race)" {
       /delay $calc(50+$rand(100))
       /reply $char(name) is a $char(race)
     } else /if "$p2"=="char(class)" {
       /delay $calc(50+$rand(100))
       /reply $char(name) is a $char(class)
     } else /if "$p2"=="char(hp)" {
       /delay $clac(50+$rand(100))
       /reply $char(name) has $char(hp,pct) percent hp ($char(hp,cur)/$char(hp,max))
     } else /if "$p2"=="char(mana)" {
       /delay $calc(50+$rand(100))
       /reply $char(name) has $char(mana,pct) percent mana ($char(mana,cur)/$char(mana,max))
     } else /if "$p2"=="char(summary)" {
       /delay $calc(100+$rand(200))
       /reply $char(name) is a level $char(level) $char(race) $char(class) with $char(hp,pct) percent hitpoints and $char(mana,pct) percent mana.
     } else /if arg(1,"$p2")=="gem" {
       /delay $calc(50+$rand(100))
       /reply $char(name) has $char(gem,$arg(2,"$p2")) in gem $arg(2,"$p2")
     }
/return

sub FindLastWord
/varset a(4,2) 1
:FindLastWordloop
  /if $arg($a(4,2),"$p0")!="" {
   /varadd a(4,2) 1
   /doevents
   /goto :FindLastWordLoop
  }
/return $calc($a(4,2)-1)

Iceassassin
a lesser mummy
a lesser mummy
Posts: 49
Joined: Tue Nov 05, 2002 11:40 am

Holy Crap!

Post by Iceassassin » Sat Nov 16, 2002 2:54 pm

Is this like so u can have druid on another comp... and be like HEAL ME **** and they'll heal u auto?

Gonezo
orc pawn
orc pawn
Posts: 10
Joined: Wed Nov 13, 2002 1:38 am

Kind of....

Post by Gonezo » Sat Nov 16, 2002 6:02 pm

I am currently working on the test version of unibot by adding more faetures. I am using this macro to learn the laguage. So, if I do not understand something that one of the more skilled codes puts here in the fourm it will prolly not be in the next release or it might be in a slighty different format than what you expected. Also, unitbot for right now is 100% command driven and in the next release once the code gets alrger and little harder to read I think i will make a read me file so people know what to do. Also, ry to read through the code cuz it is the bext way to understand how it works. If you want to send me ideas for new things catch me in chat I am almost always there.
NEW COMMANDS IN DEVELOPMENT:
hf-------->it means Heal Full and it will take the master from what ever
hp% to 100% provided he the guy does not run out of mana.
Join------>The bot will join the current group invite
Follow--->The bot will target the master then auto-follow on him
Clickies->This will be first for speicific item(ie my shaman's sow booties)
However, I do want to get it to a point where you can tell unibot
to click a certain item or slot.
loot------>If you are like me your bot will be your loot bitch cuz his str is
Higher. So, I want to work a command that will make auto loot
the nearest corpse to him. I do want to get it to a point where
he will loot the corpse you tell him to but I do not know how to
do word commands yet. If anyone has an idea on how to
break up commands by spaces(ie reading the whole line then
throwing the string into a variable and then when you reach a
space stop for that var and put the next set of chars into
another variable and so forth)
override->You gave control of your bot to a friend and need him like now.
But you really do not feel like starting and stoping the bot or
is the bot at your friends computer. Well override is your friend
"overridecode####" set that last number up to anything you
want. That command will call a sub that will reset v99 to
hardcoded name in the bot. This is a nice feature I like and
think it will help some people out who like to share their bots.

THE BEINGING STEPS OF THE "GOAUTO" COMMAND ARE BEING STARTED
Go auto will be a way to set the bot to run through the if subs to see if those requirements have been meet and if they have do the extra calls. This will happen also while listening for the stopauto or sa command so that you can grab your bot back for blatiently being a macro.

Thanks all for letting me brainstorm
If you have an idea and do not feel like coding it please put the command name you want(no profainity will be allowed in commands) and a very good discrption of what you want it to do.
-Gonezo
:D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D