BryceTheCoder Posted February 28, 2012 Share Posted February 28, 2012 Hello guys, iv been playing with this for weeks and havnt seemed to get it correct. How would i draw maybe something simple, like a box or an image or text on the Screen while running the bot using canvas stuff? I dont know how to do it:/ Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 28, 2012 Share Posted February 28, 2012 Canvas are not hard, the simple solution to not having to understand canvases is just use bitmaps. Here is a Progress report function i wrote for ubex to display multiple lines strings at any position on the screen. [scar] Procedure UBMultiText(Text: TStringArray; TColor, BColor, X, Y:Integer); Var I,II,III,BMP: Integer; ATPA: T2dPointArray; begin BMP := BitmapFromString(200,Length(Text)*15,''); // set width and height (Height is set by the length of the string) FastDrawClear(BMP,BColor); // fills the BMP i just made SetLength(ATPA,Length(Text)); For I := Low(ATPA) to High(ATPA) do begin ATPA := LoadTextTPA(Text, OptionChars); // TPA for text is loaded with all the points of ea pixel of ea letter III := High(ATPA); for II := 0 to III do FastSetPixel(BMP, ATPA[iI].X, ATPA[iI].Y+(I*15), TColor); // this sets a pixel of color at each point in TPA end; SmartDebugBitmap(BMP,X,Y); // bmp that i made is now copied to smart canvas FreeBitmap(BMP); end; [/scar] ---------- Post added at 06:25 AM ---------- Previous post was at 06:19 AM ---------- If you want to understand canvas's then heres the syntax: >> Create BMP same size as RS Page >> Get the BMP Canvas (make TCanvas Var and use the function GetBitmapCanvas) >> Store the handle of smartdebug into the canvas class handle >> Make another Canvas .. Do what you wish to it >> Then safeCopyCanvas to the original canvas bam you done. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted February 28, 2012 Author Share Posted February 28, 2012 Alright cool ty, but when i run it i get something saying it does not understand the code "SmartDebugBitmap" EXACT ERROR: Line 213 Unknown identifier 'SmartDebugBitMap' My line 213: SmartDebugBitmap(BMP,X,Y); Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 28, 2012 Share Posted February 28, 2012 Alright cool ty, but when i run it i get something saying it does not understand the code "SmartDebugBitmap" EXACT ERROR: Line 213 Unknown identifier 'SmartDebugBitMap' My line 213: SmartDebugBitmap(BMP,X,Y); because its built ontop of include UBeX and just call the function from there if you want to see it in action. [scar] program New; {$I UBeX\UBeX.scar} begin SetupUBeX; UBMultiText( [ 'UB Ulimate Yew Chopper', //'Current Player: '+ Left(Players[CurrentPlayer].Name,10), //'Current Lvl: '+IntToStr(LVL[currentPlayer]), //'Location: '+' EdgeVille', //'Logs Cut: '+IntToStr(ItemsDone[CurrentPlayer]), //'Logs/Hr: '+IntToStr(LogsHR), //'XP Gained: '+FloatToStr(XPNow), //'XP/Hr: '+IntToStr(XPHour), //'GP/Hr: '+IntToStr(GPHour), //'Players Arround: '+IntToStr(PC), //'Break In: '+IntToStr(Timings)+' Mins', 'Time Ran: '+Left(STimeRunning,15), 'Made By: ShadowRecon.', 'UnitedBots.Net' ],clYellow,clBlack,548,207); end. [/scar] Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted February 28, 2012 Author Share Posted February 28, 2012 um... wth? Line 23 Globls.scar Duplicate identifier 'OSI_Variance' All i added was "{$I UBeX\UBeX.scar}" and of cource the "SetUpUBeX" and "FreeUBeX" Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 28, 2012 Share Posted February 28, 2012 just include UBeX nothing else. OSI is already included with UBeX because UBeX is based off of OSI Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted February 28, 2012 Author Share Posted February 28, 2012 even from only having "{$I UBeX\UBeX.scar}" it gives me the same error. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 28, 2012 Share Posted February 28, 2012 Copy the code i posted and run that. Or check and make sure you UBeX is updated. Quote Link to comment Share on other sites More sharing options...
rsutton Posted February 28, 2012 Share Posted February 28, 2012 This is because in the bottom of your script im betting your putting SetUpOSI; Instead of that put SetUpUbex; If you dont have this it will create error ike the one above. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 28, 2012 Share Posted February 28, 2012 This is because in the bottom of your script im betting your putting SetUpOSI; Instead of that put SetUpUbex; If you dont have this it will create error ike the one above. You know i didnt even think about that. =/ Quote Link to comment Share on other sites More sharing options...