Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Since the boss said no problem, I edit the topic :D

тут можно задать вопрос по скриптингу
Post Reply
wokao98
Posts: 6
Joined: 27.11.2017 16:54

Since the boss said no problem, I edit the topic :D

Post by wokao98 »

Since the boss said no problem, I edit the topic :D
Last edited by wokao98 on 29.11.2017 13:29, edited 1 time in total.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: report bug with v8.6.0

Post by Vizit0r »

GetGumpInfo(GetGumpsCount-1, gumpInfo);
wait(WaitTime);
while gumpInfo.XmfHTMLGumpColor[2].Hue <> 16927 do begin
if Dead or not Connected then Exit;
NumGumpButton(GetGumpsCount-1,4);
CheckLag(60000);
wait(100);
GetGumpInfo(GetGumpsCount-1, gumpInfo);
wait(100);
end;

often get the out of range error
ofcourse.
Because no any guarantee that gumpinfo will be always taken with XmfHTMLGumpColor array. You make no checks f.e. Length(XmfHTMLGumpColor) > 0, just directly taking array element value. If array empty = error.
It's your bug, not stealth.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
wokao98
Posts: 6
Joined: 27.11.2017 16:54

Since the boss said no problem, I edit the topic :D

Post by wokao98 »

Since the boss said no problem, I edit the topic :D
Last edited by wokao98 on 29.11.2017 13:30, edited 1 time in total.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: report bug with v8.6.0

Post by Vizit0r »

Line, where error raised, is
while gumpInfo.XmfHTMLGumpColor[2].Hue <> 16927 do
?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply