Thread Tools Display Modes
08-20-10, 05:14 AM   #1
kiingz
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 13
Addon to run "/" commands on login

Heya.

I need an addon that will run commands like /script <command> on login.

http://www.wowwiki.com/API <-- those types, obviously not the protected functions.

I know there was an addon that did this but I cant remember its name.

Last edited by kiingz : 08-20-10 at 05:17 AM.
  Reply With Quote
08-20-10, 07:56 AM   #2
SaraFdS
A Fallenroot Satyr
 
SaraFdS's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 24
You don't need an Addon to run these Commands, in fact, Addons consist of these, so basically you're going to write your own little Addon, so here's just the basic steps:

Create a new folder in your AddOns folder called NameOfYourAddon.
Inside it, create two new files called NameOfYourAddon.toc and CallThisHoweverYouWish.lua. Make sure their file type actually is .toc and .lua, it's a common mistake that people create files like MyAddon.lua.txt.

Now, open those files with a simple text Editor (Notepad will do):

.toc file:
Code:
## Interface: 30300
## Title: Myaddon

CallThisHoweverYouWish.lua
Interface determines the Interface Version your Addon is supposed to work with, if it is older (smaller) than the Client's current Version, your Mod will show up as "Out of Date"
Title is simply what your Addon will be called in the Addon selection screen.
After that, you have to load the files which contain the actual code, in your case CallThisHoweverYouWish.lua.

.lua file:
Here you put all the "commands" you want the game to execute on load, no need for /run or sth, just plain text.

When you're done, start the game and enjoy your very own addon
__________________
Sará the Insane
  Reply With Quote
08-20-10, 08:54 AM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by SaraFdS View Post
Interface determines the Interface Version your Addon is supposed to work with, if it is older (smaller) than the Client's current Version, your Mod will show up as "Out of Date"
Just as an fyi, if the number is *at all* different (even if it's higher, or you have a typo, or an appended a) from the current WoW version, it will show as "out of date".
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-21-10, 08:29 AM   #4
kiingz
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 13
Doesn't seem to work, I think it runs those command while at the loading screen which does nothing, any way to make it wait until I've actually logged in before it runs them?

Last edited by kiingz : 08-21-10 at 08:43 AM.
  Reply With Quote
08-21-10, 02:12 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Try hooking them into an event like this.

lua Code:
  1. local frame=CreateFrame("Frame");
  2. frame:RegisterEvent("PLAYER_LOGIN");
  3. frame:SetScript("OnEvent",function(self,event,...)
  4.     -- Put code here
  5. end);

If you want to learn more about writing addons, the Interface Customization section of http://www.wowwiki.com is a great reference tool.
Also check out http://www.lua.org for documentation on the Lua programming language.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-21-10 at 02:16 PM.
  Reply With Quote
08-21-10, 02:52 PM   #6
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
If that doesn't work, you might want to change PLAYER_LOGIN into VARIABLES_LOADED, delaying the function until saved variables are loaded.
  Reply With Quote
08-21-10, 07:24 PM   #7
Dameek
A Murloc Raider
 
Dameek's Avatar
Join Date: Jan 2009
Posts: 6
I know I didn't post in here.....but I was trying to do something similar and this helped me greatly! Thanks !
  Reply With Quote
08-23-10, 04:24 PM   #8
kiingz
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 13
Originally Posted by SDPhantom View Post
Try hooking them into an event like this.

lua Code:
  1. local frame=CreateFrame("Frame");
  2. frame:RegisterEvent("PLAYER_LOGIN");
  3. frame:SetScript("OnEvent",function(self,event,...)
  4.     -- Put code here
  5. end);

If you want to learn more about writing addons, the Interface Customization section of http://www.wowwiki.com is a great reference tool.
Also check out http://www.lua.org for documentation on the Lua programming language.
This worked! thanks
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Addon to run "/" commands on login

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

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