Results 1 to 7 of 7

Thread: Counter for a script / Question

  1. #1
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Counter for a script / Question

    Hey dudes i am using a free firemaking script from that forum. For Personal Use i wanted to add a Log/h Counter, but it's not working
    in the procedure DeclarePlayer i've addet this
    Code:
    Log:='Teak'; // Please Type in the Logs you are Burning, For Process Report //Logs,Achey,Oak,Willow,Teak,Maple,Mahogany,Arctic,Eucalyptus,Yew,Magic //
    Log is string

    Then at the proggy procedure i've addet this

    Code:
    if log ='Logs'
    	then  XPL :=40
    	else if Log ='Achey'
    		then  XPL :=40
    		else if Log ='Oak'
    			then XPL :=60
    			else if Log ='Willow'
    				then XPL :=67.5
    				else if Log ='Teak'
    					then XPL :=105
    						else if Log ='Maple'
    						then XPL :=135
    							else if Log ='Mahogany'
    							then XPL :=157.5
    								else if Log ='Arctic'
    								then XPL :=140.2
    									else if Log ='Eucalyptus'
    									then XPL :=193.5
    										else if Log ='Yew'
    										then XPL :=202.5
    											else if Log ='Magic'
    											then XPL :=303.8
    											end;
    										end;
    									end;
    								end;
    							end;
    						end;
    					end;
    				end;
    			end;
    		end;
    	end;
    end;
    XPL (XP per Log) is integer, my problem is that it won't compile. What am i doing wrong? Thanks for answer =]
    also tried other variables for XPL like LongInt, but none is working

  2. #2
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Just use a case
    Simba Code:
    const
      log = 'magic';
    var
      XPL: Integer;
    begin
      case lowercase(Log) of
        'logs': XPL:= 40;
        'achey': XPL:= 40;
        'oak': XPL:= 60;
        'willow': XPL:= 67;
        'teak': XPL:= 105;
        'maple': XPL:= 135;
        'mahogany': XPL:= 157;
        'artic': XPL:= 140;
        'eucalyptus': XPL:= 193;
        'yew': XPL:= 202;
        'magic': XPL:= 304;
      end;
      WriteLn(XPL);
    end.

  3. #3
    Join Date
    Mar 2012
    Location
    Canada
    Posts
    870
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    That's the biggest if/else statement I've ever seen on this forum.
    My scripts:
    Advanced Barb Agility Course(outdated), MonkeyThieverV0.11, MahoganyTableV0.4(outdated)
    Questions? I bet that for 98% of those, you'll find answer HERE

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by sir eska eau View Post
    That's the biggest if/else I've ever seen on this forum.
    Correction - that's the pointiest is/else you've ever seen on this forum.

    I mean you could stab someone with that....



    OT: Yeh tehq pretty much said it all, cases is your best friend here mate

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    u declare XPL as integer but clearly some of ur XPL is not integer (whole numbers) but decimals instead. Try declare XPL as extended, or Round ur XPL to integers.

  6. #6
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    allright guys thanks a lot for helping =) tehq i will try this =)
    eska&abu, i know^^ i am new into runescape scripting, just had pascal in school and we made all with if then else variables, i will look forward into pascal scripting for rs =) thanks

  7. #7
    Join Date
    Apr 2012
    Location
    Cell beside Joe
    Posts
    102
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Correction - that's the pointiest is/else you've ever seen on this forum.

    I mean you could stab someone with that....



    OT: Yeh tehq pretty much said it all, cases is your best friend here mate
    *if/else
    But things can always be pointer
    Cases. But is there any other way than cases?

Thread Information

Users Browsing this Thread

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

Posting Permissions

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