Quantcast
Auto open calendar on login - WoWInterface
Thread Tools Display Modes
04-27-21, 07:11 PM   #1
Yukka
An Aku'mai Servant
 
Yukka's Avatar
Join Date: Feb 2020
Posts: 32
Auto open calendar on login

Hi I sometimes forget to open the calendar to watch if there's events today or next days, I cant make addons because I have no knowledge, can someone nice share the code or create an addon that auto open the calendar when login with a character? Thanks a lot.
  Reply With Quote
04-28-21, 12:59 PM   #2
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 283
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetScript("OnEvent", ToggleCalendar)
  3. f:RegisterEvent("PLAYER_ENTERING_WORLD")
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
04-28-21, 04:40 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,050
That'll open the calendar every time you load in a new area too. I'd suggest using PLAYER_LOGIN instead.
If you need help converting code into an addon, there's a handy tool to do that. Just give it a name for the title and paste the code in the area below.
__________________
ESOUI AddOns | 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 : 04-28-21 at 04:46 PM.
  Reply With Quote
04-28-21, 04:45 PM   #4
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 283
Originally Posted by SDPhantom View Post
That'll open the calendar every time you load in a new area too.
Good point! :-) Make it this then:

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetScript("OnEvent", function(_, _, isLogin, isReload)
  3.   if isLogin or isReload then ToggleCalendar() end
  4. end)
  5. f:RegisterEvent("PLAYER_ENTERING_WORLD")

Originally Posted by SDPhantom View Post
I'd suggest using PLAYER_LOGIN instead.
Also good, if you don't care about the reload.
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
04-28-21, 05:02 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,050
Originally Posted by LudiusMaximus View Post
Also good, if you don't care about the reload.
Last I checked, it still works on reload. You just can't differentiate it between a login or reload.
__________________
ESOUI AddOns | 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)
  Reply With Quote
04-28-21, 05:04 PM   #6
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 283
Originally Posted by SDPhantom View Post
Last I checked, it still works on reload. You just can't differentiate it between a login or reload.
Ah, even better! Then definitely go for this:

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetScript("OnEvent", ToggleCalendar)
  3. f:RegisterEvent("PLAYER_LOGIN")
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
04-30-21, 04:45 AM   #7
Yukka
An Aku'mai Servant
 
Yukka's Avatar
Join Date: Feb 2020
Posts: 32
AMAZING Thanks a lot guys! I'll never miss an event anymore.

Wish you good health
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Auto open calendar 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