Thread Tools Display Modes
10-07-07, 12:25 AM   #1
Mooid
A Murloc Raider
Join Date: Oct 2007
Posts: 4
Lost... This script doesn't work or create errors...

All this is supposed to do is execute an LUA file from the webserver that simply says:

dkp = 300;

After that it should update every 30 seconds and input that text into the simpleHTML field inside the XML layer, but it does nothing. I added the chat messages to see if it was even working and it doesn't even say anything in the chat window... Any help would be great

I don't really know much about making addons or LUA work, I am just a lowly PHP developer who normally does server-side applications lol

My XML
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!--Autogenerated by wowuides, Version=1.0.300.0, Culture=neutral, PublicKeyToken=null-->
  <Frame name="NSDKPForm" movable="true" enableMouse="true">
    <!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="f15d4971-d66d-444e-bb2d-1ad102c87fed" />-->
    <Size>
      <AbsDimension x="302" y="56" />
    </Size>
    <Anchors>
      <Anchor point="TOPLEFT" relativeTo="UIParent">
        <Offset>
          <AbsDimension x="100" y="-100" />
        </Offset>
      </Anchor>
    </Anchors>
    <Backdrop bgFile="interface\dialogframe\ui-dialogbox-gold-background" edgeFile="interface\dialogframe\ui-dialogbox-gold-border" tile="true">
      <BackgroundInsets>
        <AbsInset left="11" right="12" top="12" bottom="11" />
      </BackgroundInsets>
      <TileSize>
        <AbsValue val="32" />
      </TileSize>
      <EdgeSize>
        <AbsValue val="32" />
      </EdgeSize>
      <Color r="1" g="1" b="1" />
      <BorderColor r="1" g="1" b="1" />
    </Backdrop>
    <Frames>
      <SimpleHTML name="$DKPreadout" file="|H%s|h%s|h">
        <!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="3eecda8a-2e43-4781-999f-95a367166924" />-->
        <Size>
          <AbsDimension x="274" y="30" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="14" y="-14" />
            </Offset>
          </Anchor>
        </Anchors>
        <FontString>
          <FontHeight>
            <AbsValue val="14" />
          </FontHeight>
          <Color r="0" g="1" b="0" />
        </FontString>
      </SimpleHTML>
    </Frames>
  </Frame>
</Ui>
And my LUA

Code:
dkp = 0;
function RefreshDKP()
    playername = UnitName("player");
    remotedkp = "http://www.nocturnalsymphony.com/test/addondkp.php?p=" .. playername;
    dofile(remotedkp);
    DKPreadout:SetText("You have " .. dkp .. " DKP");
    DEFAULT_CHAT_FRAME:AddMessage("DKP Refreshed");
    Chronos.schedule(30,RefreshDKP);
end

function InitDKP()
    playername = UnitName("player");
    DKPreadout:SetText("Loading DKP for " .. playername);
    DEFAULT_CHAT_FRAME:AddMessage("Loading DKP for " .. playername);
end

Chronos.afterInit(RefreshDKP);
  Reply With Quote
10-07-07, 08:22 AM   #2
mulesh
A Chromatic Dragonspawn
 
mulesh's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 193
Code:
remotedkp = "http://www.nocturnalsymphony.com/test/addondkp.php?p=" .. playername;
You cannot access a web document from within the game client.

Code:
dofile(remotedkp);
The "dofile()" function is not part of the WoW API, it is a custom function of the WoWbench program to run ready-made LUA scripts in a WoW enviornment.
__________________
"Don"t tase me bro!" ~ Andrew Meyer
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Lost... This script doesn't work or create errors...


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