Attempting to make a Language bot.

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

boldor
a ghoul
a ghoul
Posts: 94
Joined: Tue Sep 10, 2002 11:46 am

Attempting to make a Language bot.

Post by boldor » Thu Jun 19, 2003 10:30 am

Currently attempting make a language teaching bot. Call would contain the name of the controller. ie /macro Langbot <master>

Would have a set of defined commands to start and stop teaching based upon tells. Also trying to change languages 2-25 depending on which language I want to learn.

I am having some issues when trying /gsay wanting to send the text in the current language.

I issue say in tell Lang15 the bot changed his language to Goblin<15>
Next issue Teach where the "/gsay this is a test" is issued.

The text from /gsay appears in common instead of goblin any ideas?

Is there a way to /click left on a Hotkey bank button?
Here is inital code:

Code: Select all

#define MasterName v50 
#define RelayTell v74 
#chat tell 



Sub Main 
   /if n $strlen("$p0")<=0 { 
     /echo Usage: /macro generic <Master Name> 
     /endmacro 
   } 
   /varset MasterName $p0  
   /varset RelayTell 1 
  
   /tell $MasterName What is thy bidding my master? 
   :MainLoop 
   
   /doevents 
   /delay 5
   /goto :MainLoop 
/return 



Sub Event_Chat 
   
   /if "$MasterName"=="$p1" { 
      
   /if $arg(1,"$p2")==Teach { 
      /gsay This is a test      

   } 
   /if $arg(1,"$p2")==Lang15    { 
      /lang 15 
      /reply I am now teaching Goblin 

   } 
   else { 
       /if n $RelayTell==1 /tell $MasterName $p1 told me: $p2 
   } 
/return 
Thanks

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Thu Jun 19, 2003 1:10 pm

Easiest way I can think of to press a hotkey is

Code: Select all

/press 1
for hotkey 1

Code: Select all

/press 2
for hotkey 2

etc...

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Thu Jun 19, 2003 2:02 pm

I think, although I'd need a codemonkey to confirm it, when MacroQuest talks, it talks directly to EQ's chat buffer, without bothering to actually insta-type it into the window, therefore bypassing and language stuff.

One way past this I'd think, would be to use a combination of /sendkey enter up and /press h /press i /press , /press spacebar /press t etc etc etc in order to type your chat directly into the window, then /sendkey enter up to send it. Not sure how well it would work, but if it did, the chat would be going directly into the chatbar, and with #turbo it could go extremely fast.

But yeah, a better solution is just to make hotkeys with the chat you want, and have the macro simply press the hotkeys once the language is set.

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

boldor
a ghoul
a ghoul
Posts: 94
Joined: Tue Sep 10, 2002 11:46 am

Post by boldor » Thu Jun 19, 2003 9:58 pm

Thanks Guys /press 1 did the trick.

Now I have another issue where I am trying to tell MASTER which language I am trying to Teach
I /tell Bot Lang 2

Code: Select all

|   series of these for all languages bot knows
   /Varset a(1,0) "filler since no Lang0 exists"
  /Varset  a(1,1)  "Common"
  /varset  a(1,2)  "Barbarian"

Sub_main left out as its not important to idea im trying to  get resolved

Sub event_chat
  /if $arg(1,"$p2")==Lang   { 
      /lang $arg(2,"$p2") 
      /delay 5
      /tell $MasterName I am now ready to start teaching $a(1, $arg(2, "$p2")).
   } 
The Master gets a tell like

Bot tells you, "I am now ready to start teaching @a(1,2)"

It was my desire to return the string variable stored in the array as part of the text message so it looks like this:

Bot tells you, "I am now ready to start teaching Barbarian"

Any idea as to what I am doing wrong?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Jun 19, 2003 10:32 pm

use no spaces in variables