What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

'Pulse'! Exception

axazol

New Member
Joined
Jun 27, 2010
Messages
308
Reaction score
8
Hello there..

I need little help with C# codding.

I have a part of code to get specific ID's from mails:
Code:
bool GetSourceFromMails(string ID)
        {
            slog("---------------------------");
            Thread.Sleep(500);
            int count = 0, ma_cnt = MailFrame.MailCount;
            slog("Mails - " + ma_cnt.ToString());
            for (int i = 1; i <= ma_cnt; i++)
            {
                for (int a = 1; a <= 12 ; a++)
                {
                    string source = Lua.LuaGetReturnValue("return GetInboxItemLink (" + i.ToString() + "," + a.ToString() + ")", "source.lua")[0].ToString();
                    slog("Get link succes");
                    source = Regex.Replace(source, @"(^(\|\w+\|\w+:)|((:?:-?\d*)*\|\w.(:?\w+ )*\w*.\|\w\|\w)$)", "");
                    slog("Regex succes");
                    if (source == ID && Me.FreeNormalBagSlots > 12)
                    {
                        slog("Check succes");
                        Lua.DoString("TakeInboxItem(" + i.ToString() + "," + a.ToString() + ")");
                        slog(">> Item to bag");
                        ++count;
                    }
                    else slog("Check fail "+source.ToString());
                }
            }
            slog("Done");
            if (count > 0) return true;
            else return false;
        }

Now a problem:
When i use is alone in "public override void Pulse()" it's working fine. But when i put it in some if/else logic it's fail, and i continiusly gettin an error without explanations:
"Plugin testplugin threw an exception in 'Pulse'! Exception:"
 
Hello there..

I need little help with C# codding.

I have a part of code to get specific ID's from mails:
Code:
bool GetSourceFromMails(string ID)
        {
            slog("---------------------------");
            Thread.Sleep(500);
            int count = 0, ma_cnt = MailFrame.MailCount;
            slog("Mails - " + ma_cnt.ToString());
            for (int i = 1; i <= ma_cnt; i++)
            {
                for (int a = 1; a <= 12 ; a++)
                {
                    string source = Lua.LuaGetReturnValue("return GetInboxItemLink (" + i.ToString() + "," + a.ToString() + ")", "source.lua")[0].ToString();
                    slog("Get link succes");
                    source = Regex.Replace(source, @"(^(\|\w+\|\w+:)|((:?:-?\d*)*\|\w.(:?\w+ )*\w*.\|\w\|\w)$)", "");
                    slog("Regex succes");
                    if (source == ID && Me.FreeNormalBagSlots > 12)
                    {
                        slog("Check succes");
                        Lua.DoString("TakeInboxItem(" + i.ToString() + "," + a.ToString() + ")");
                        slog(">> Item to bag");
                        ++count;
                    }
                    else slog("Check fail "+source.ToString());
                }
            }
            slog("Done");
            if (count > 0) return true;
            else return false;
        }

Now a problem:
When i use is alone in "public override void Pulse()" it's working fine. But when i put it in some if/else logic it's fail, and i continiusly gettin an error without explanations:
"Plugin testplugin threw an exception in 'Pulse'! Exception:"

Try change this row
Code:
string source = Lua.LuaGetReturnValue("return GetInboxItemLink (" + i.ToString() + "," + a.ToString() + ")", "source.lua")[0].ToString();
into this
Code:
string source = Lua.GetReturnVal<string>(string.Format("return GetInboxLink({0},{1})", i, a), 0);
 
Thanks alot, i'll.

PS: As i can understand there is a some sort of data missing when HB write "Plugin testplugin threw an exception in 'Pulse'! Exception:" with a colon at the end?
Expanded part of log:
[15:22:34:214] Plugin testplugin threw an exception in 'Pulse'! Exception:
[15:22:34:321] StyxWoW.AreaManager.CurrentGrindArea is null
[15:22:34:369] NeedToMoveToTarget?
[15:22:34:521] Activity: Getting Items from mailbox
[15:22:34:564] interact: 0x17D71BC0
[15:22:34:773] interact done: 0x17D71BC0
 
Last edited:
Code:
string source = Lua.GetReturnVal<string>(string.Format("return GetInboxLink({0},{1})", i, a), 0);
Missing < string > i guess? ;)<string><string><string><string></string></string></string></string></string>
 
Last edited:
Back
Top