Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

sjesper

Members
  • Content count

    141
  • Joined

  • Last visited

Community Reputation

10 Good

About sjesper

  • Rank
    Senior Member
  • Birthday March 4

Personal Information

  • Location
    Denmark
  • Interests
    IT, Coding
  • Occupation
    School >(

Contact Information

  • Skype
    kiks136
  1. <p><p><p>Hej, kan du opdatere dit SDM script til KomOgVind?</p></p></p>

  2. Best Computer to buy for like 500-700$?

    Do yourself a deal and don't buy a laptop from clevo that offer enduro. I bought a i7 2,3 ghz Hyperthreading, 8gb ram, 180gb ssd, 7970m. The switchable gfx driver is bugged so the 7970m only get's up to about 60-70%.
  3. Hello. As the title says i'm trying to activate a window that i found by using FIndWindowsEx. Here is what i got to: [sCAR] program New; var HWDC: THwndArray; Client: TSCARWindowClient; begin HWDC := FindWindowsEx(GetDesktopWindow, 'Note', '', False, False, True); ActivateWindow(HWDC[0]); writeln(HWDC[0]); Client.Handle := HWDC[0] Client.Activate; end.[/sCAR] But i get this error: Could not call proc (Unknown error).
  4. GetWords

    This function return the words in a string. This is only adviced to be used with 100-150 words, or it will take long time to get the words (This can ofc be used as a kind of "wait" in your script). 10 words ~ 54 ms (0.054 seconds) 50 words ~ 277 ms (0.277 seconds) 100 words ~ 700 ms (0,700 seconds) [sCAR]function GetWords(S: String): TStringArray; var Len, i, ii, Index, L: Integer; S2: String; TSA: TStringArray; begin L := Length(S); TSA := Explode(' ', S); for ii := 0 to high(TSA) do begin for i := low(TSA) to high(TSA) do begin Index := Pos(TSA, S); Len := PosEx(' ', S, Index); S2 := Copy(S, Len + 1, 1); if S2 = ' ' then Delete(S, Len, 1); end; end; for i := 1 to L do begin if i = 1 then if not StartsWith(' ', S) then break; Len := Pos(' ', S); if Len = 1 then begin Delete(S, Len, 1); end else begin break; end; end; result := Explode(' ', S); end; var i: Integer; TSA: TStringArray; begin TSA := GetWords('Hello Hello Hello Hello Hello Hello Hello Hello Hello HelloHello Hello HelloHello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello HHello Hello Hello Hello Hello Hello o Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hell Hello H'); for i := 0 to high(TSA) do writeln('TSA[' + IntToStr(i) + '] = ' + TSA); end.[/sCAR]
  5. strGet, or its alternative? (getSubStr)

    Just found a bug in my function. If you puted some spaces in the beginning of ur string it would count them as words. I have fixed that and pasted the function in here: - http://forums.scar-divi.com/showthread.php?1618-CountWords&p=8590#post8590
  6. CountWords

    Return the number of words in the given string [sCAR] function CountWords(S: String): Integer; var Len, i, ii, Index: Integer; S2: String; TSA: TStringArray; begin TSA := Explode(' ', S); for ii := 0 to high(TSA) do begin for i := low(TSA) to high(TSA) do begin Index := Pos(TSA, S); Len := PosEx(' ', S, Index); S2 := Copy(S, Len + 1, 1); if S2 = ' ' then Delete(S, Len, 1); end; end; result := length(Explode(' ', S)); for i := 1 to Length(S) do begin if i = 1 then if not StartsWith(' ', S) then exit; if PosEx(' ', S, i) = i then begin result := result - 1; end else begin break; end; end; end; begin writeln('The number of words: ' + IntToStr(CountWords(' Hello there '))); end.[/sCAR]
  7. GetResolution

    Ah nice. And you just answered my badly formulated answers =) (Asked if u would change anything else in the window functions) :-)
  8. GetResolution

    This looks great =) I can't believe you made that many new window functions. Great job on the new 3.35 :-) Are you going to make more updates with the functions using this function or is this unknown ?
  9. strGet, or its alternative? (getSubStr)

    At first i through i just could use the Explode(' ', S) but then i saw that i it would be missleading if you made two spaces between your words. So then i wrote this :-) [sCAR]function CountWords(S: String): Integer; var Len, i, ii, Index: Integer; S2: String; TSA: TStringArray; begin TSA := Explode(' ', S); for ii := 0 to high(TSA) do begin for i := low(TSA) to high(TSA) do begin Index := Pos(TSA, S); Len := PosEx(' ', S, Index); S2 := Copy(S, Len + 1, 1); if S2 = ' ' then Delete(S, Len, 1); end; end; result := length(Explode(' ', S)); end; begin writeln('The number of words: ' + IntToStr(CountWords('Hello. Whats up im'))); end.[/sCAR]
  10. GetResolution

    Ahh thanks :-) And yeah it's lot easier to get the size of a not set client instead of you have to activate it, get infos and go back to the old. Great work at 3.35
  11. GetResolution

    [sCAR]procedure GetResolution(out w, h: Integer); var {$IFNDEF SCAR335_UP} HWDC: Integer; {$ENDIF} begin {$IFNDEF SCAR335_UP} HWDC := GetClientWindowHandle; SetDesktopAsClient; GetClientDimensions(w, h); SetClientWindowHandle(HWDC); {$ELSE} GetWindowSize(GetShellWindow, w, h); {$ENDIF} end;[/sCAR] This gets your current resolution. This function will work when 3.35 comes out (Thanks to Freddy ).
  12. Split text with multiline

    When you make a #13/#10 shouldn't you make the ''#13#10' but only #13#10. Here is an example of how to do your example: [sCAR] var s: String; TSA: TStringArray; I: Integer; begin s := 'Hello' + #13#10 + 'Im awe' + #13#10 + 'some'; TSA := Explode(#13#10,s); for i := 0 to high(tsa) do writeln('TSA[' + IntToStr(i) + ']: ' + TSA); end.[/sCAR] Just ask if you have more questions :-)
  13. SCAR Divi 3.35 Preview/Tutorial

    Awesome videos. I was wondering when the final version of 3.35 is coming. I would guess it's gonna take really long time as you need to make a lots of documentions for all the new and edited functions.
  14. Wondering how FindBitmaps is working?

    I think u missunderstod me I want to make a FindDTMs (There is only a FindDTM function (Not with a s)). So i gave an example of the FindBitmaps function and asked how the function is builed up. I do know how to use it ^^
  15. Hello :-) I was wondering how FindBitmaps is working, cause i'm planning to make a FindDTMs myself. The FindColors wouldn't be that hard. I would guess it's just copying the client to a bitmap and then looping every pixel on the bitmap and adding the coordinates when it find one to a TPA, and add the finded coordinate to a kind of "dont-use" TPA, so it wont find it anymore. Like: [sCAR]If TPAContains(DontUse, CurrentTP) then Continue;[/sCAR] But Bitmaps is not just one pixel. It can be a hundred of pixels. So i was wondering if it search for one and if it find one it would avoid those pixel it was at in the continue of the for loop? But if it does that, then what there is a bitmap in a bitmap of the same kind? Thanks :-)
×