Author Topic: GBot - Global Bot  (Read 54926 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: +403
  • Referrals: 11
    • View Profile
GBot - Global Bot
« on: March 18, 2009, 12:41:09 PM »
0
Code: [Select]
;==================================================
; Script Name: GBot - Global Bot A
; Author: Cerveza
; Version: 1
; Shard OSI / FS: OSI
; Revision Date: 2007/08/08
; Purpose: Control second char using EUO interface:
;          This is PRIMARY player script
; Special Thanks: TrailMyx and Endless Night
;==================================================
Code: [Select]
;=================================================
; Script Name: GBot - Global Bot B
; Author: Cerveza
; Version: 1
; Shard OSI / FS: OSI
; Revision Date: 2007/08/08
; Purpose: Control second char using EUO interface
;          This is SECONDARY player
; Special Thanks: TrailMyx and Endless Night
;=================================================

Dual client helper. Run GBot A on your main char and GBot B on your support char.

Simple Global Variable watcher. I wrote this to teach myself globals. It has auto peace making with it, but I'm not sure it still works. The auto peace used a trick with party to avoid the wait timer. You can also see where I remmed out the auto invis if the support char gets targetted. You could always put that back.

Very easy to modify this and add in functions. I've run a version that had a 4x6 button menu for casting, skills, actions, etc....

I hope it's simple enough that people will modify it on their own and discover the fun that is Global Variables  :D

If you come up with some killer mods, just put them in a reply here.

There are 2 attachment(s) in this post. You must register and post an acceptable introduction to download
GBot1A.txt
GBot1B.txt
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 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: +403
  • Referrals: 11
    • View Profile
Re: GBot - Global Bot
« Reply #1 on: March 19, 2009, 06:18:46 AM »
0
I used a modified version of this while in Doom and it worked great. It would auto-dispel revs, cut bones, heal my pet every 4 seconds, and cast Word of Death. All I had to do was keep my pet clear of poison, and help with the healing.

I also ran Dread Horn many times with this. Before I got good enough with my samp, I ran this guy as support to cure/heal me. Worked awesome.

I had been planning a PBot (party bot) that would accept party messages and perform actions based on the inputs. It's not really a "Global Variable" project though, so it's on my regular to-do list, along with many other things.
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: GBot - Global Bot
« Reply #2 on: August 03, 2009, 09:46:15 AM »
0
WHAT THIS DOES:  It adds a little menu onto Cerv's menu with 5 buttons that move you north south east west with a button click.  Also a center button for when you want your bot to move back to you no matter what.  Great for when you just want to move your guy into a new spot when you're not in follow mode.

Makes positioning your bot a little easier in spawns and such.  If you have your bot on FOLLOW, make sure to set your bot to how many spaces you want him to follow AT.  I have mine set at 3 so I can move him around in 3 spaces around my normal guy without him going into follow mode and coming back to me.  I've done a lot of interesting stuff with this so far.  Way fun to play with. :)  I have a stealth mage ninja that I use with this.  He can hide/smokebomb and invis if he's in trouble.  He heals from a distance with lesser/greater heal.  He will arch cure.  He blesses when I'm cursed.  And he can heal with bandaids when within 2 spaces of me.  Makes it nice because with this mod I can take him off follow and position him where I want for safety/tactics, even use him as a guardzone bot for healing/curing/blessing me if I'm doing some gate fighting! :)  Love it.  Nice script for learning the basics of namespaces and global vars.  THANKS CERV! :)  You should have seen my first attempt to move him using #findx #findy #findz... omg.  Then I remembered these easier commands. haha

This goes in Gbot1a
Code: [Select]
sub north
  set #menubutton n/a
  set !north ! !north
return

sub south
  set #menubutton n/a
  set !south ! !south
return

sub east
  set #menubutton n/a
  set !east ! !east
return

sub west
  set #menubutton n/a
  set !west ! !west
return

sub center
  set #menubutton n/a
  set !center ! !center
return

menu Font Style
menu Button north 160 4 49 25 North
menu Button south 160 64 49 25 South
menu Button east 124 24 29 45 West
menu Button west 212 24 29 45 East
menu Button center 160 32 49 29 Center

This goes in Gbot1b
Code: [Select]
if !north
   event macro 5 1
set !north #false

if !south
   event macro 5 5
set !south #false

if !west
   event macro 5 3
set !west #false

if !east
   event macro 5 7
set !east #false

if !center
{
   Finditem !charID G_15
   event pathfind #findx #findy #findz
}
set !center #false
« Last Edit: August 03, 2009, 09:52:09 AM by Scripty »

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: GBot - Global Bot
« Reply #3 on: August 05, 2009, 02:06:02 PM »
0
Twinkle McNugget, you drop these in at the bottom of the GA and GB scripts?  Just wanted to make sure I put them in the right spots.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Scrripty

  • Guest
Re: GBot - Global Bot
« Reply #4 on: August 05, 2009, 03:33:52 PM »
0
Twinkle McNugget, you drop these in at the bottom of the GA and GB scripts?  Just wanted to make sure I put them in the right spots.

I'll just send you my version in email, you'll like mine way better. :)

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: GBot - Global Bot
« Reply #5 on: August 05, 2009, 04:30:17 PM »
0
add in some crosshealing, super following movement, reaction to the specific template of the pet player, option for stealth following, and then we can beginning destroying uo Together
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"

Scrripty

  • Guest
Re: GBot - Global Bot
« Reply #6 on: August 05, 2009, 05:58:58 PM »
0
add in some crosshealing, super following movement, reaction to the specific template of the pet player, option for stealth following, and then we can beginning destroying uo Together

All that's in brother.  In the version I got here, I have set it up to be voice activated.  My bot follows rails to my pvp spots.  He heals on the fly, cures on the fly, blesses on the fly, and will heal with bandages if I stand by him.  I'm adding archery and a targetting system I can use with voice too, so he'll stealth to my voice commanded rail NUMBER, then dismount the person I call.  Say, attack 1.  He'll dismount the player marked with a number 1. :)  It's going to be insane. haha  I have it on auto map too, so I can watch and see where the bot is.  So I meet him with someone chasing, have him dismount, and bam.  I'm CONSIDERING adding in an auto paralyze feature too, cause he has magery, stealth, hiding, archery.  Might as well have him paralyze my target over and over too. :)

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: GBot - Global Bot
« Reply #7 on: August 05, 2009, 06:13:13 PM »
0
And thats What I meant by Destroy uo. The only Scripting in pvp i like is a Trapped Box script in the event of 3+ mages Para Spamming.
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"

Scrripty

  • Guest
Re: GBot - Global Bot
« Reply #8 on: August 05, 2009, 06:38:33 PM »
0
I fight solo 10 on 1 all the time on my shard.  A little backup will make it more interesting. :)  And I NEVER use scripts in pvp.  This will be my first one.  Cept for a pot drinker I use occasionally. :)

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: +403
  • Referrals: 11
    • View Profile
Re: GBot - Global Bot
« Reply #9 on: August 06, 2009, 06:14:20 AM »
0
I can't even begin to imagine the possibilities.

Pre Cast the G-Heal when I'm hurt, hold it till I'm in range.

Pre Cast the Flame-Strike, hold it till I release my spell.

Limitless possibilities.
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 Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: GBot - Global Bot
« Reply #10 on: August 06, 2009, 07:23:50 AM »
0
Something else for me to play with...  :D :D
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Scrripty

  • Guest
Re: GBot - Global Bot
« Reply #11 on: August 06, 2009, 08:01:45 AM »
0
I can't even begin to imagine the possibilities.

Pre Cast the G-Heal when I'm hurt, hold it till I'm in range.

Pre Cast the Flame-Strike, hold it till I release my spell.

Limitless possibilities.

Honestly I hadn't thought of that! :)  I drink cures so fast that waiting to NOT be poisoned isn't usually an issue.  I have just been doing a health check at maxhits - 25. :)  Usually that's a good range to get a heal.  Honestly man, you should have seen your Gbot in action the other night.  I had a nightmare, 3 or 4 pixies, a mage, and an archer on me and Gbot kept me up and kickin and I was on foot on a tamer/archer with healing/pots only.  :)  I lub Gbot. haha

Scrripty

  • Guest
Re: GBot - Global Bot
« Reply #12 on: August 06, 2009, 08:35:58 AM »
0
Here's a picture of the new menu.  I'll release this without the auto healing/curing/bless parts.  That's a little much, and it's easy to add, so if people take the time to learn, they can have those parts. :)  Oh yea, I took out the part that will set your weapon to shadow strike for an extra way to invis also.  This was made for a stealth/mage/ninja with fencing.  I'm switching him to archery tho.



GbotA:
Code: [Select]
;==================================================
; Script Name: GBot - Global Bot A
; Author: Cerveza
; Menu:   Twinkle McNugget
; Version: 1
; Shard OSI / FS: OSI
; Revision Date: 2007/08/08
; Purpose: Control second char using EUO interface:
;          This is PRIMARY player script
; Special Thanks: TrailMyx and Endless Night
;==================================================

namespace Global NSG1
set !follow #FALSE
set !hide #FALSE
set !unhide #FALSE
set !strength #STR
set !pause #FALSE
set !charID #charID
set #menubutton n/a
gosub showEUOMenu1

set #lpc 10

repeat
if #menubutton <> n/a
  gosub #menubutton
set !charGhost #charGhost
set !variableSTR #STR
set !hits #hits
set !maxhits #maxhits
set !charstatus #charStatus
until #clilogged = 0
 
sub hide
set #menubutton n/a
set !hide #TRUE
return

sub follow
  set #menubutton n/a
  set !follow ! !follow
  set !Color Red
  if !follow
    set !Color Lime
  menu font style b
  menu Delete follow
  menu Font BGColor !Color
  menu Button follow 5 65 81 25 Follow
return

sub unhide
  set #menubutton n/a
  set !unhide ! !unhide
  set !Color Red
  if !unhide
    set !Color Lime
  set font style b
  menu Delete unhide
  menu Font BGColor !Color
  menu Button unhide 5 5 81 25 Unhide
return

sub north
  set #menubutton n/a
  set !north ! !north
return

sub south
  set #menubutton n/a
  set !south ! !south
return

sub east
  set #menubutton n/a
  set !east ! !east
return

sub west
  set #menubutton n/a
  set !west ! !west
return

sub center
  set #menubutton n/a
  set !center ! !center
return

sub incog
  set #menubutton n/a
  set !incog ! !incog
return

sub res
  set #menubutton n/a
  set !res ! !res
return

sub protect
  set #menubutton n/a
  set !protect ! !protect
return

sub reveal
  set #menubutton n/a
  set !reveal ! !reveal
return

sub invis
  set #menubutton n/a
  set !invis ! !invis
return

sub arcur
  set #menubutton n/a
  set !arcur ! !arcur
return

sub masd
  set #menubutton n/a
  set !masd ! !masd
return

;--------- EasyUO Menu Designer Code Begin ---------
sub showEUOMenu1
menu Clear
menu Window Title GBot
menu Window Color Teal
menu Window Size 245 94
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style b
menu Font Color WindowText
menu Font BGColor Red
menu Button unhide 5 5 81 25 Unhide
menu Font BGColor Lime
menu Button hide 5 35 81 25 Hide
menu Font BGColor Red
menu Button follow 5 65 81 25 Follow
menu Font Style
menu Font BGColor Yellow
menu Button north 124 4 41 25 North
menu Button south 124 64 41 25 South
menu Button east 88 32 33 29 West
menu Button west 168 32 33 29 East
menu Button center 124 32 41 29 Center
menu Font BGColor Aqua
menu Button incog 204 4 33 25 Incog
menu Button reveal 204 32 33 29 Rveal
menu Button invis 204 64 33 25 Invis
menu Button res 168 4 33 25 Res
menu Button arcur 168 64 33 25 ArCur
menu Button protect 88 4 33 25 Prot.
menu Button masd 88 64 33 25 MasD
menu Show

return
;--------- EasyUO Menu Designer Code End ---------

GbotB:
Code: [Select]
;=================================================
; Script Name: GBot - Global Bot B
; Author: Cerveza
; Menu:   Twinkle McNugget
; Version: 1
; Shard OSI / FS: OSI
; Revision Date: 2007/08/08
; Purpose: Control second char using EUO interface
;          This is SECONDARY player
; Special Thanks: TrailMyx and Endless Night
;=================================================

;gosub setpixel-secondary

namespace Global NSG1
set %timer #sCnt
set !blesstime = #time
;set %peacetime #sCnt
;set %pt 2 ; <----- Time in seconds between peacemaking
;set %inst QRF_NRF_MQF_PRF_LQF_OQF_RGP_KRF
 
set #lpc 10

repeat

===== Heal Aids =====
if !hits < !maxhits && !charGhost = NO && #enemyId = N/A
{
   finditem ZLF C_ , #backpackid
   if #findkind <> -1
   {
      set #lObjectID #findid
      gosub doitb 17 0 !charID 5
   }
}

===== Heal Ressurect =====
if !charGhost = YES && #time > %time2 && #enemyId = N/A
{
   finditem ZLF C_ , #backpackid
   if #findkind <> -1
   {
      set #lObjectID #findid
      gosub doitb 17 0 !charID 9
   }
}

===== Unhide =====
if !unhide = #true
{
   event macro 2 0 Beep!
   set !unhide = #false
}

===== Incognito =====
if !incog = #true && !charGhost = NO
{
  gosub doit 15 34 none 3 !charstatus   ; Incognito
  set !incog #false
}

===== Ressurect =====
if !res = #true && !charGhost = YES
{
  gosub doit 15 28 !charID 3s !charstatus   ; mage ressurrect
  set !res #false
}
  
===== Protection ====
if !protect = #true && !charGhost = NO
{
  gosub doit 15 14 none 3s !charstatus   ; mage protection
  set !protect #false
}

===== Reveal ====
if !reveal = #true && !charGhost = NO
{
  gosub doit 15 47 !charID 3s !charstatus   ; mage reveal
  set !reveal #false
}

===== Invis ====
if !invis = #true && !charGhost = NO
{
  gosub doit 15 43 !charID 3s !charstatus   ; mage invis
  set !invis #false
}

===== Arch Cure ====
if !arcur = #true && !charGhost = NO
{
  gosub doit 15 24 !charID 3s !charstatus   ; mage arch cure
  set !arcur #false
}

===== Mass Dispel ====
if !masd = #true && !charGhost = NO
{
  gosub doit 15 53 !charID 3s !charstatus   ; mage cure
  set !masd #false
}

===== Hide Bot =====
if !hide = #TRUE
  gosub doit 13 21 NONE 10
set !hide #FALSE

===== Follow =====
Finditem !charID G_15
if #finddist > 3 && !follow = #true
    event pathfind #findx #findy #findz

==== North ====

if !north
   event macro 5 1
set !north #false

if !south
   event macro 5 5
set !south #false

if !west
   event macro 5 3
set !west #false

if !east
   event macro 5 7
set !east #false

if !center
{
   Finditem !charID G_15
   event pathfind #findx #findy #findz
}
set !center #false

===== Invis Bot if Targetted =====
finditem #enemyid G
if #findcnt > 0 && H notin !charstatus
  {
    event macro 15 43
    target 5s
    set #ltargetKind 1
    event macro 23 0
    wait 10
    set #enemyID n/a
  }

===== Anti Logout =====
if #sCnt > %timer + 300
  {
    event macro 8 1
    set %timer #sCnt
  }


Until #Clilogged = 0 || #CharGhost = YES
halt

===== SUBS =====

;---------Bandaids---------------------
; %1 = Event Macro Param 1
; %2 = Event Macro Param 2
; %3 = Target ID or NONE
; %4 = Spell Delay
sub doitb
  if %3 = NONE
    {
      event macro %1 %2
      wait %4
      return
    }
  finditem %3 G_2
  if #findkind = -1
      return
  set #ltargetID %3
  set #ltargetKind 1
  finditem ZLF C_ , #backpackid
  if #findkind <> -1
  {
     set #lobjectID #findid
     event macro %1 %2
     target 5s
     event macro 22 0
     set %time2 #time + %4
  }
return

;-------------------------------------
; %1 = Event Macro Param 1
; %2 = Event Macro Param 2
; %3 = Target ID or NONE
; %4 = Spell Delay
sub doit
  if %3 = NONE
    {
      event macro %1 %2
      wait %4
      return
    }
  finditem %3 G_11
  if #findkind = -1
      return
  set #ltargetID %3
  set #ltargetKind 1
  event macro %1 %2
  target 5s
  event macro 22 0
  wait %4
return

;=================================================================
; Script Name: TrailMyx's Journal Scanning subs (#jindex based)
; Author: TrailMyx
; Version: 1.3
; Shard OSI / FS: OSI / FS?
; Revision Date: 2007/07/09
;-------------------------------------------------------------------------------
; Brings !_jindex up to the most recent #journal entry
sub TM_SyncTextScan
  namespace push
  namespace local text
  set !_jindex #jindex + 1
  namespace pop
return
;-------------------------------------------------------------------------------
; %1, %2, %3, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
sub TM_FindValidTextNoAdvance
  namespace push
  namespace local text
  set !temp_lpc #LPC
  set #LPC 1000
  set !num_args %0
  set !first_arg 1
  if !_jindex = N/A
    set !_jindex #jindex
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= #jindex
    {
      scanjournal !temp_jindex
      str pos #JOURNAL #CHARNAME 1
      set !namepos #STRRES
      str pos #JOURNAL :_ 1
      set !smcpos #STRRES
      str pos #JOURNAL !text 1
      set !textpos #STRRES
      if !textpos < !smcpos && !smcpos <> 0
        set !pass #TRUE
      else
        set !pass #FALSE
      if ( !text in #journal && ( :_ notin #JOURNAL || !namepos = 1 || !pass ) )
      {
        set !temp_jindex !temp_jindex + 1
        set #LPC !temp_lpc
        namespace pop
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until ( ( !index - !first_arg ) >= ( !num_args - 1 ) )
  set #LPC !temp_lpc
  namespace pop
return #FALSE
;-------------------------------------------------------------------------------
; %1, %2, %3, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
sub TM_FindValidText
  namespace push
  namespace local text
  set !temp_lpc #LPC
  set #LPC 1000
  set !num_args %0
  set !first_arg 2
  if !_jindex = N/A
    set !_jindex #jindex
  set !index !first_arg
  repeat
    set !text % . !index
    while !_jindex <= #jindex
    {
      scanjournal !_jindex
      if !text in #journal
      {
        if :_ , !text notin #journal
        {
          set !_jindex !_jindex + 1
          set #LPC !temp_lpc
          namespace pop
          return #TRUE
        }
      }
      set !_jindex !_jindex + 1
    }
    set !index !index + 1
  until ( ( !index - !first_arg ) >= ( !num_args - 1 ) )
  set #LPC !temp_lpc
  namespace pop
return #FALSE
;-------------------------------------------------------------------------------
; %1, %2, %3, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Will not advance %_jindex pointer to allow for scanning journal history for more than one search.
sub TM_FindTextNoAdvance
  namespace push
  namespace local text
  set !temp_lpc #LPC
  set #LPC 1000
  set !num_args %0
  set !first_arg 2
  if !_jindex = N/A
    set !_jindex #jindex
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= #jindex
    {
      scanjournal !temp_jindex
      if !text in #journal
      {
        set !temp_jindex !temp_jindex + 1
        set #LPC !temp_lpc
        namespace pop
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until ( ( !index - !first_arg ) >= ( !num_args - 1 ) )
  set #LPC !temp_lpc
  namespace pop
return #FALSE
;-------------------------------------------------------------------------------
; %1, %2, %3, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Advances !_jindex so that you won't scan for past journal entries.
sub TM_FindText
  namespace push
  namespace local text
  set !temp_lpc #LPC
  set #LPC 1000
  set !num_args %0
  set !first_arg 2
  if !_jindex = N/A
    set !_jindex #jindex
  set !index !first_arg
  repeat
    set !text % . !index
    while !_jindex <= #jindex
    {
      scanjournal !_jindex
      if !text in #journal
      {
        set !_jindex !_jindex + 1
        set #LPC !temp_lpc
        namespace pop
        return #TRUE
      }
      set !_jindex !_jindex + 1
    }
    set !index !index + 1
  until ( ( !index - !first_arg ) >= ( !num_args - 1 ) )
  set #LPC !temp_lpc
  namespace pop
return #FALSE

« Last Edit: August 06, 2009, 12:14:41 PM by Scripty »

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: +403
  • Referrals: 11
    • View Profile
Re: GBot - Global Bot
« Reply #13 on: August 06, 2009, 10:48:25 AM »
0
Twinkle McNugget, you need to edit that header to include "Menu by Twinkle McNugget" :)

Thanks for using this. Your doing exactly what I originally made the GBot for, so people could use it as a guide for Globals and expand to create their own dual (triple or more?) client system.

I tried to make it generic enough that people could just look at it, and understand what was going on. How different stuff was passed from one client to the other, and how the other would react. Once people get that, it's *really* simple to add stuff in.
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: GBot - Global Bot
« Reply #14 on: August 06, 2009, 11:14:57 AM »
0
Twinkle McNugget, you need to edit that header to include "Menu by Twinkle McNugget" :)

Thanks for using this. Your doing exactly what I originally made the GBot for, so people could use it as a guide for Globals and expand to create their own dual (triple or more?) client system.

I tried to make it generic enough that people could just look at it, and understand what was going on. How different stuff was passed from one client to the other, and how the other would react. Once people get that, it's *really* simple to add stuff in.

This was just a very basic first attempt.  I did a lot of playing around before I got serious.  That's a powerfull little toy.  More people should get into playing with it.  SO many possiblities... :)  I hope people take a look at what I've done and get a better idea of how to incorporate stuff.  Took all of 5 minutes looking at your code for me to think of 1000000 uses for it. haha  My next step with what I have done is to add a web interface for guildies to control my Gbot when I'm not actively using it.  Shouldn't be too hard to do that once I figure it out.  Man the voice control stuff is so nice... You just key words up to key combos.  It's pretty cool to be fighting and say, "FOLLOW!" and have him come running! haha  Or say a number and he runs to that rail spot, and watch him on automap then just run up and he heals. :)  He's died a few times tho, I need to add in some more life saving features for Gbot! :(

Tags: Cerveza