Results 1 to 10 of 10

Thread: Waddos random most likely useless functions

  1. #1
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Waddos random most likely useless functions

    When I'm bored, I do pointless stuff.

    There so pointless there useful great anti ban because what macro speaks. . . pig latin =]

    My fist probably useless function
    SCAR Code:
    function backwards(Sentence:string):string;
    var
      i:integer;
      w:string;
    begin
      for i:=0 to high(sentence) do
        w:=(right(left(sentence,i),1))+w;
        result:=w;
    end;

    How to use

    Writeln(backwards('hello'));

    Whats it do

    Flips a word around.
    eg the example above ('hello') would become olleh.


    Second

    SCAR Code:
    function getdigit(number,pos:integer):integer;
    begin
        result:=strtoint(right(left(inttostr(number),pos),1));
    end;

    What it does.

    Returns a single digit from a number

    How to use.
    writeln(inttostr(getdigit(772472654,5)));
    this will return the 5 digit which is 7.




    Function number 3

    GetDigitsRange - uses getdigit

    SCAR Code:
    function getdigitsrange(numb,startpos,endpos:integer):integer;
    var
      i:integer;
      t:string;
    begin
      for i:= startpos to endpos do
        t:=t+inttostr(getdigit(numb,i));
      result:=strtoint(t);
    end;

    What it does.
    Returns a few digits from a number

    How to use.
    writeln(inttostr(getdigitsrange(772472654,3,5)));
    this will return the 3rd to 5th digits which are 247.

    My 4th

    SCAR Code:
    Function muddle(word:string):string;
    var
      i,f:integer;
      w:string;
    begin
      for i:=0 to 1 do
      for i:=0 to high(word) do
      begin
        w:=(right(left(word,f),1))+w;
        incex(f,2);
        if f>high(word) then f:=1;
      end;
      result:=w;
    end;

    What does it do.
    It muddles up a word im to tired to get it to do what i actually wanted (123456 to 135246) but it will do.

    How to use.
    writeln(muddle('hello'));
    hello becomes olhle.


    If you have any ides for other pointless functions that may at some point have a use post. =]


    My 5th.

    SCAR Code:
    Function despel(word:string):string;
    var
      i,f,z:integer;
      w:string;
    begin
      z:=1
      for i:=0 to 1 do
      for i:=0 to high(word) do
      begin
        w:=w+(right(left(word,f),1));
        if random(50)=random(50) then
          z:=2;
        incex(f,z);
        if z=-1 then z:=1;
        if z=2 then z:=-1;
        if (high(w)=(high(word)-1)) and (random(5)=2) then break;
        if (high(w)=(high(word))) then break;
      end;
      result:=w;
    end;

    What does it do.
    It misspells word's and could be the first usefull thing in here. =]

    How do you use.
    writeln(despel('hello'));


    6th
    World prefix generator

    SCAR Code:
    program New;
    var
      prefix:string;
    begin
       prefix := ReadINI('World' + readln('Enter the world number'), 'Prefix', AppPath + 'includes\SRL\SCSS\worlds.ini');
      if(prefix = '')then
      begin
        writeln('Invalid world number or corrupted world list. Please review your settings');
        TerminateScript;
      end else
      writeln(prefix);
    end.


    7th
    Pig Latin Convertor


    SCAR Code:
    function piglatin(word:string):string;
    var
      I:integer;
      suffix:string;
      randchar:char;
    begin
      for i:=1 to high(word) do
      begin
        case word[i] of
          'a', 'e', 'i', 'o' : break;
          'u': begin
                 if i>1 then
                   if word[i-1]<>'q'then break;
                 if i=1 then break;
               end;
        end;
        suffix:=suffix+word[i];
      end;
      case random (3)+1 of
        1:randchar:='h';
        2:randchar:='w';
        3:randchar:='d';
      end;
      if i=1 then
      result:=word+''''+randchar+'ay'
      else
      result:=right(word,(high(word)-High(suffix)))+''''+suffix+'ay';
    end;

    What it does.

    Converts an English word into Pig Latin.

    How to use.

    writeln(piglatin('quest'));




    SCAR Code:
    program New;

    function ConvertCaps(word:string):string;
    var
      i:integer;
    begin
      for i := 1 to high(word) do
        if inrange(ord(word[i]),65,90) then
          result:=result+chr(ord(word[i])+32)
        else
        result:=result+word[i];
    end;

    begin
      writeln(trimcaps('Hello'));
    end.

    input 'Hello'

    output 'hello'



    SCAR Code:
    program New;

    function TrimCaps(word:string):string;
    var
      i:integer;
    begin
      for i := 1 to high(word) do
        if not inrange(ord(word[i]),65,90) then
          result:=result+word[i]
    end;

    begin
      writeln(trimcaps('Hello'));
    end.

    input 'Hello'

    ouput 'ello'




    Exploder

    SCAR Code:
    Program New;

    Function ExplodeW(Sentence, SplitAt : String):TStringArray;
    var
      ArrayPos : Integer;
      SentencePos : Integer;
    begin
      SetArrayLength(result,high(sentence)+1)
      for SentencePos := 1 to High(Sentence) do
        if Sentence[SentencePos]<>SplitAt then
        begin
        SetArrayLength(result,high(sentence)+1)
          Result[ArrayPos] := Result[ArrayPos]+Sentence[SentencePos];
        end else
        If High(Result) > 0 then Inc(ArrayPos);
    end;

    var
      words:TStringArray;
      i:integer;
    begin
      words:=ExplodeW('Waddos string exploder',' ');
      for i := 0 to high(words) do
        writeln(words[i]);
    end.

    input waddos string exploder
    output waddos
    string
    exploder


    SCAR Code:
    function CambridgeSpeak(Word:string):string;
    var
      Letters:TStringArray;
      i:integer;
      buildword:string;
    begin
      setarraylength(letters,high(word)+1);
      for i := 2 to high(word) do
        letters[i]:=word[i];
      begin
        for i := 0 to Length(letters) * 3 do
          Swap(letters[Random(Length(letters))], letters[Random(Length(letters))]);
        buildword:=word[1];
        for i := 0 to Min(High(letters), high(word)+1) do
          buildword:=buildword+letters[i];
        result:=buildword+word[high(word)];
      end;
    end;

    input waddo
    output wdado



    SCAR Code:
    program New;

    procedure LoadUnique1(Strings: TStringArray; Count: Integer);
    var
      s: TStringList;
      Str: string;
      i: Integer;
    begin
      s := TStringList.Create;
      while (s.Count < Count) do
      begin
        Str := Strings[Random(Length(Strings))];
        if (s.IndexOf(Str) > -1) then Continue;
        s.Add(Str);
      end;
      for i := 0 to s.Count -1 do
        WriteLn(s[i]);
      s.Free;
    end;

    procedure LoadUnique2(Strings: TStringArray; Count: Integer);
    var
      s: TStringList;
      i: Integer;
    begin
      s := TStringList.Create;
      while (Length(Strings) > 0) and (s.Count < Count) do
      begin
        i := Random(Length(Strings));
        s.Add(Strings[i]);
        Swap(Strings[i], Strings[High(Strings)]);
        SetLength(Strings, High(Strings));
      end;
      for i := 0 to s.Count -1 do
        WriteLn(s[i]);
      s.Free;
    end;

    procedure LoadUnique3(Strings: TStringArray; Count: Integer);
    var
      i: Integer;
    begin
      for i := 0 to Length(Strings) * 3 do
        Swap(Strings[Random(Length(Strings))], Strings[Random(Length(Strings))]);
      for i := 0 to Min(High(Strings), Count - 1) do
        WriteLn(Strings[i]);
    end;

    begin
      LoadUnique1(['hello','arfef','magic','srl','scar'], 4);
      WriteLn('----');
      LoadUnique2(['hello','arfef','magic','srl','scar'], 4);
      WriteLn('----');
      LoadUnique3(['hello','arfef','magic','srl','scar'], 4);
    end.

    them 3 things pulls a number of itms from an array will not duplicate positions
    they where made by nielsie


    this one by me

    SCAR Code:
    function loadunique(words:TStringArray;Number:integer):TStringArray;
    var
      Used:TIntegerArray;
      Done:integer;
      curtry:integer;
      count:integer;
      isused:boolean;
    begin
      repeat
        begin
          isused:=false;
          curtry := random(high(words)+1);
          for count := 0 to high(used) do
          begin
            if curtry = used[count] then
            isused:= true;
          end;
          if not isused then
          begin
            setarraylength(result,getarraylength(result)+1);
            setarraylength(used,getarraylength(used)+1);
            used[getarraylength(used)-1]:=curtry;
            result[getarraylength(result)-1]:= words[curtry];
            inc(done);
          end;
        end;
      until done >= number;
    end;

    var
      thing:Tstringarray;
      i:integer;
    begin
     thing:=loadunique(['hello','arfef','magic','srl','scar'],4);
      for i := 0 to high(thing) do
        writeln(thing[i]);
    end.
    Blank!

  2. #2
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cool, make one that switches every other letter in a word:

    skilld
    kslidl

  3. #3
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey thats my next one =]

    Great minds think alike.

    Can anyone think of any practical uses.

    *note to self make a typsenderror which can randomly spell wrong
    Blank!

  4. #4
    Join Date
    May 2008
    Posts
    203
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Waddo View Post
    *note to self make a typsenderror which can randomly spell wrong
    If you make a script that does that, make sure the mistyped letters are typed a bit faster, as if your finger rolled off on to the next key.

    Example would be spelling "first" as "firwst". Imagine your finger rolling on 2 keys at once, they are typed faster.

    Just a suggestion to your good ideas

  5. #5
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Added a new function that misspells stuff.

    that sentence put in gave
    Added a new funtction that misspells stuf
    Added a new function that missplells tfufuff
    Added an new functio n that misspells stuff
    Addde d a new fucitoion that misspells stuff
    Added a new functoion that mispspells stuuff
    Blank!

  6. #6
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    new function

    Pig Latin translator.


    arrrghhh dog trying to eat my pot noodle.
    Blank!

  7. #7
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    2 new functions
    Blank!

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

    Default

    For the first one, there is no need for the variable w. You could just use result (it could also be shorter)

    For the second one, you overcomplicated it. You could just do
    SCAR Code:
    Result:= StrToInt(IntToStr(number)[pos]);

    You overcomplicated the third one also. It could just be
    SCAR Code:
    Result:= StrToInt(copy(IntToStr(numb), startpos, startpos - endpos));

    Fourth,
    SCAR Code:
    for i:=0 to 1 do
    does nothing

    Fifth is the same as fourth.

    Seventh, it seems to me by just glancing at it that it would give an error if you passed a word that starts with a u. And also, you need to use lowercase in that case.


    There's all my constructive criticism for a year

  9. #9
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    waht aobut mainkg a sircpt that mxies the caahertrcs in the mdlide of a wrod?

  10. #10
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yer im gunna do that soon
    Blank!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Little thingy, useless actually :p
    By Laur€ns in forum First Scripts
    Replies: 9
    Last Post: 06-03-2008, 11:19 PM
  2. Waddos mage trainer
    By Waddo in forum RS3 Outdated / Broken Scripts
    Replies: 5
    Last Post: 05-22-2008, 03:15 PM
  3. most useless link ever
    By mamoth95 in forum Misc. Links and Programs
    Replies: 4
    Last Post: 07-01-2007, 01:26 AM
  4. Useless link is...
    By afi in forum Misc. Links and Programs
    Replies: 10
    Last Post: 04-21-2006, 06:12 AM

Posting Permissions

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