Results 1 to 9 of 9

Thread: Help: Canvas Does Not Allow Drawing

  1. #1
    Join Date
    Jun 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help: Canvas Does Not Allow Drawing

    I'm starting work on my first script and I'm having trouble logging in. I'm trying to use a bitmap of the "Click Here To Play" button upon loading runescape but i keep getting this error when I try to run it.

    Here is my script thus far(Sorry if its hard to read, The spaces disappeared when i posted it):

    program FirstScript;
    {.include SRL/SRL.scar}
    var
    LogPlay: Integer;

    procedure DeclarePlayers;
    begin
    HowManyPlayers := 6; //Number of PLAYERS. active or not.
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0; //Player to start on.

    //set all user names, passwords and nicks correctly please.

    Players[0].Name := 'name here';
    Players[0].Pass := 'password here';
    Players[0].Nick := 'nick';
    Players[0].Active := True;

    Players[1].Name := 'Brandelo666';
    Players[1].Pass := 'password here';
    Players[1].Nick := 'nick';
    Players[1].Active := True;

    Players[2].Name := 'UserName';
    Players[2].Pass := 'Password';
    Players[2].Nick := '3-4 letters of UserName';
    Players[2].Active := False;

    Players[3].Name := 'UserName';
    Players[3].Pass := 'Password';
    Players[3].Nick := '3-4 letters of UserName';
    Players[3].Active := False;

    Players[4].Name := 'UserName';
    Players[4].Pass := 'Password';
    Players[4].Nick := '3-4 letters of UserName';
    Players[4].Active := False;

    Players[5].Name := 'UserName';
    Players[5].Pass := 'Password';
    Players[5].Nick := '3-4 letters of UserName';
    Players[5].Active := False;

    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;

    procedure DeclareBitmaps;
    begin
    LogPlay := BitmapFromString(152, 51, 'z78DAED9D4B721B490C44AF44' +
    '4996C65E8E3DA3FB1FC90E161759F3904950B49B8A1860D1A 1687' +
    '657D72FF12B003A9D86868686868686868686868686868686 8686' +
    '868686868686868686868686868686868686868686FE4B5FB E9E9' +
    'E4FA7D7D7D3DBE949AF6FDF9F7E9CBEE9DFFAE4FAFB72E7EF A7D7' +
    'D3D775D5B72EEFBE3EFD7AE4EDDFE75F37B485E2CEF9DDCBF 3EB2' +
    'AADAD27D75BBCB39E2FFA2F7DDBFAAC2D60A49C0DCE125BD3 2F6E' +
    '63C1EC7174FABCCE0FFBB99EE16CE83CB839DCC672EEE75FE F2FC' +
    'FCFCFC57A494FF4F997EFA797D3695D7506D695BFBAD67436 F8D6' +
    '362219A33ECF1571BD72FB96F7736BC7D06595D7A8D75ED25 D81F' +
    '9BC5C65758AD597FDBF5AD6755F7FEB55BFABF72FDF959DB3 BD25' +
    'AD6DE82622CED7D5DB0B42E30ED4EF5E76C5B9B5D5827EFDD B8F2' +
    'FEF2FFFE89ED75F756EF5DD4B9FD7AF7A9555C86BB15A7018 D7FE' +
    'EB7A694F383ACE09F1B2F1078332F2EA0E37CBEDB86F650C3 A8EE' +
    '1EEE4D68E21B70A449FDE59FB61C32376D726BF847BEB1889 B27C' +
    'E51A69FB9B1CD1ABE0911281A373B35148F3F335F7D9B5C91 EEA2' +
    '88A91629EC90D0AC92B18E7AEA3EC26F6B94BC92B9487E85C 11CB' +
    '79CE1D823AD8FF181EFBD743F555E196051EA91161E750575 CBB7' +
    '1ED994D9B95B520429D46C477B5E7EB2B2A77DC2A731479BC E4F0' +
    '8A05E29473421D60D31964E655D653C776DA7E81475CA973A AD6E' +
    '1DAA1E6E6F4A5CD7269C83BC7FD3AB8D0AF38DD95E873F349 CDD9' +
    'B576A47CDC640DAC18C5979BB782FF43BF22DFD6961D1EDDB B2AE' +
    'FACCE6976057BB5D96266360A0922FDCFF691B30AF32E22C7 D8A4' +
    '86F49CF3407BD3EDCF4DC7C64C52CF77BD7258234F7312B98 347F' +
    'D7A1F8F4EF7F89C782CE687481444649EB9ED40C7BDA565DD 5DB4' +
    'B0AC956ABC4FDBD72123D83787CA4247C54837F9A218875E4 A3BC' +
    '8DA89D004366D101A02F99ED30AB61980A72BF35BA73967DE E2F4' +
    '5EDA2F795F2997765A4DC6571E57A7B543E523FC8185E626F D2C7' +
    '430586DD4AC684FD18ACC7659D6420BBB0CFE8DC21382F5BD 321B' +
    'C0B8EA99ECBF6A89D448E90B2AB4083E0F89433E40AD83562 4659' +
    'F7B9EBE74FADC0ADFB5F10B39FFADC308F1D8F105F5E563A7 B5E3' +
    'E563D628B63BB001379F1EAC516A9E1BFA0CA2F557BE5BC82 FE39' +
    'F2CA452638C794EB2EF883E5ECE40C7EEDBB881B6497D0072 D6C9' +
    '1A67FDD157B39DADA88F9A9C193A27B1EFECF4FE6C5FF1D34 2E23' +
    'BFD337FD1B576241E0BEB0356A4F527D0D30ECF7FB60536C9 420B' +
    '287A1D0BCF89F1FFE7134C878BC2474A8986FE1712C469C8E 867F' +
    '14595E0824AD5F6E92FE2195621F7C19D28D7F87C46A5EEE4 C2BF' +
    '8A73CF8E14E87B4D6FF5A0E63314FDFBB1FE1CF27F9E3250B BE30' +
    '9A03BD1A62EEAF0583CE9CED979FA69FCFFFD31BA9D599C96 5263' +
    '173DC1CA535CA909F02B852D0C0B91FAA4C566B4AFB3972C9 F30D' +
    '2FF465F6E4762FEB96BFF5B07C50398BDEDFC96EBFA0E623C 8CFE' +
    '5AF842CF6BF46E88FB93CFD017A4BF2A4FD85AA6B5086958F 4E4F' +
    'CEB765FDE7A6F50E749EE817ECBD4B53AEFD20BEADA275E8A 7349' +
    'B337740F500AB33FE40C9D99713872CF70B77C223CCA9C5F4 E997' +
    '14EC7D95B2D381CF1499EB57166B6BE01B3FCA2F2DBFC244F 5D39' +
    '3AF745377677DF917BD271B67ECB8CB2587DCBDF551DA933C F0E2' +
    'F8E57E776DCECB17DC572A77D873B6DDFDD7F707C8E398752 8D65' +
    'CD865BD3F51663F0321ED77561BFD8E7A605C529B98AE3CC1 CAF3' +
    'BCB733BCAA183F254FB4F7DB53F52D7137BB283280245A55D 8BC8' +
    '4FC89D2847A86F147D463BFA961B7B07590E5FF7E3917D383 27E5' +
    '53DF33C1170BB91DA8BD3E2B84B552BEECB1DE71D753A2D47 5A44' +
    '6AA1CD3E6A5CFF9D3FE77EC9DBF2E7201AD661C4FE1AFBCC3 38B8' +
    'C7DC7CF3B78CC92B183BBACF93B1DE35178A42FA2F02D37D6 947E' +
    'F2CCDB556BBD6137225641F74696892E3A28E331AF2371EA6 CCF8' +
    'EAE9575C842A76D9F77645E7A2B1E19C99CF5CFFE18FBF2B1 B33A' +
    'D9B675594E3C213A5E5F75715C59AFE06960B634DDC95A47C 3A1F' +
    '7893917CE5F6163C918771D57ADAFF95097EE7369E590B9E5 4E3C' +
    '801B914A1F27D1B2F4549D2AFBFA1C12FB78CC16935B1DC60 3743' +
    '0EB3CBDC7C7E7D87C8D2CAD4CEE9ED3EEC85DFB787451910E 8F2A' +
    '4D72AEDF154F94D93957EC479C925F91B6F094B6347668B0E 4ABD' +
    '976B8550F7439AD999B6D9EB4C8B7E92BCE1A6F475FEDE3D1 61F3' +
    '78F9C8E8AF3CCF3CBFC8EB58C4E7985972F3CFF8738747F24 C77A' +
    'EC793F7BE3FC7E1D7E93FB9877D3D5323C7982DC2E8A09B11 17D1' +
    '4A6D2A633F476BF7FD9CB78EA22F1F3BA79007F973903FA85 E3BE' +
    'E617AB19CFFAD33CFD903E0FC663CD5B21A3256A138178064 B955' +
    '5EDB55863FB9D3429E43976F65CFFDA35FC89D3AE5D3961C7 5967' +
    '5E30E1E5DFBF7F873AEACD4A7C123BF9BE3FCDDC982B6C953 8C5B' +
    '8971291DDF69B658F3197AE60F568EC4A806CABE3ED2A921E 4780' +
    '0461065B9401FA98B07D079EED458B0D6A8F169DF337B7D3C 7EEC' +
    'CCF1B1F1E4CE1E747E1EA7FD5E220AE43CFA2E5D5ABC0756B ECB7' +
    'EA02FC55901362FFE3C0385958D51ABD6DDF766BBF82837F6 5BE3' +
    'AC58AF83EDD8EA43E7B732DF2EB01CBD1F1D19D4971D599AE 45FF' +
    '94C3FDEF51862E6AFE6F5BB8C27E6B9E70A1B455DACC86373 DD1E' +
    'C64076AA7F70EFF1198E7ADB81AA259A2C3CE70D73F95C576 2801' +
    '9676B6A5E15D1BF9095F493307F93F953ACECC18C2D5BC90A 7DCE' +
    '51DF8C70C8B9CFF74492DF1A977EBC3FC77920DD8906FDDEA E268' +
    '0D3A38A738778C7D94DAC60E0F22C180FCF9302E66E7422C3 7305' +
    '9B5BF3506835B82CECA20E4FAC0FA0FBDCE695BB8A64269B8 93C3' +
    '6575770B52072759D8E95D78944751C29B776BC7CCCF1FFCE ABB9' +
    'AD026A1EDACC262208D256D7D4E5EAE68A8BCCF17196B2D3F 78A9' +
    'DEC3880AB9B01A957708098B3C9D8A77B7219AE64029A1C64 27AD' +
    '5893A7C80169640DBB35FA1335AFC8013AAD1D5FCFCA554A5 4D9C' +
    '43A1EAC89C48C42CBF35DFB262F9295318A7C3D79CBD61F68 E45D' +
    'E68A168574C3E9833B6F65EE27F3B82DB73115B78ABC27530 F846' +
    '794AC4BA9F76D7520E80C19EF85EC039673A59D2293C55468 F918' +
    '1E736B479E77143190B1AA2A2D8BA2769CB4ECEA00588BC3E 95AD' +
    '4CD3492C1E4ED661BCA595E5B8D5954CC282A2582A715B558 1BD5' +
    'C05C1502ADEEC813C022BB1018A79E6CEB0CC34E7759F32EB B3C9' +
    'FAD776CC95B33949DFE9011972B9E3D2A5EEE4A9527D42F65 EE21' +
    '4FF929FDA979E68A0A2E0B833A214F7E19976BFB4FFDD3448 76ED' +
    'A66ACD9CE1636191AEB15308AC0E63BA39E6491238C7CFCC2 BF24' +
    '3366CF264C2D472B976375F74E45F12B1563620DA58E7C74D CCFB' +
    '5F6A878005D17E609BA9AA86A9B17553D752723DFEA0ADECF BF6E' +
    '5999AC5F0AED94F59A2825898EA2FFF862519118FDCFDE834 2CF8' +
    '7B5C25A8ED62F6DEAB5EA0C3BF9EBAAF3655B959E81CC5133 12F3' +
    'C99A93747D2CFFAED60ECDEF303EC0824BD33E42FD34EA608 E875' +
    '3B6BAF899A2AE9AF18D1095C4027D2FCC0075DE4567391235 CE86' +
    '2D346AF83C5D1DF52BFF6F05FFC7814F2E84BA6A48596ABBC 837F' +
    '28A7EDDB6A2F23C2CD93ECA3E86C7DF75423A343434343434 3434' +
    '3434343434343434343434343434343434343434343434343 4343' +
    '43434F4FFA49FD89D3B46');
    end;

    procedure LogIn;
    var
    x,y: Integer;
    begin
    ActivateClient;
    Mouse(459,289,2,2,true);
    SendKeys(Players[CurrentPlayer].Name+chr(13));
    SendKeys(PLayers[CurrentPLayer].Pass);
    Mouse(315,320,2,2,true);
    wait(10000);
    if(FindBitmap(LogPlay,x,y)) then
    begin//<<<<<<<<<<<<<<<<<<<<<<<LINE 163>>>>>>>>>>>>>>>>>>>>>>>
    WriteLn('Found Bitmap!');
    Mouse(x,y,1,1,true);
    end else
    WriteLn('Bitmap Not Found!');
    end;



    begin//main loop
    DeclarePLayers;
    DeclareBitmaps;
    LogIn;
    end.//mai loop
    and this is the error I'm getting:

    [Runtime Error] : Exception: Canvas does not allow drawing in line 163 in script
    If anyone knows how I can fix this issue I would appreciate it.

  2. #2
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    I've gotten that error before.

    Sometimes I've gotten rid of it by opening it in a new SCAR. Try that, see if it helps.

  3. #3
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    That bitmap is massive!

    You only need a 2x50 max; 25x1 should work fine here. Just make a bitmap that spans one pixel across some of the text

    Also, to keep spaces from dissappearing, use [SCAR] - [/SCAR]
    Interested in C# and Electrical Engineering? This might interest you.

  4. #4
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    He's right. No need for that size of a bitmap.

    And if by some chance you do need a bitmap of that size, it looks better, script-wise, to store it in a separate file. Then just use LoadBitmap(Path); to get it into your script.

  5. #5
    Join Date
    Jun 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright I'll try making a smaller bitmap and see if that helps at all, and I'll keep the scar wrap in mind for later.

  6. #6
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Usually when you get the canvas error its because you're accidentally trying to search coordinates that lie outside the client screen. Make sure all your color search coordinates are correct.

  7. #7
    Join Date
    Jun 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright I double checked everything and I didn't see anything wrong. Everything seems to be working fine now though I'm not sure what that really was. Thanks for everyones input though.

    EDIT: BTW Your O RLY baby is sweet as hell!

  8. #8
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Make sure you selected the RS client with the crosshair. That's sometimes the problem.

    EDIT: Oh you figured it out?

  9. #9
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That is a massive bitmap :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 05-28-2008, 07:01 PM
  2. FindColor - Canvas does not allow drawing...
    By FrÕzÑ_§ÕµL in forum OSR Help
    Replies: 1
    Last Post: 04-02-2008, 07:26 AM
  3. [Runtime Error]:Canvas does not allow drawing
    By sp00nfu11 in forum OSR Help
    Replies: 3
    Last Post: 03-22-2008, 12:52 PM
  4. canvas does not allow drawing in line 153
    By oliver1205 in forum OSR Help
    Replies: 2
    Last Post: 02-23-2008, 06:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •