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:
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:"
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:"