Dark Signs J forum
Utility Scripts - Printable Version

+- Dark Signs J forum (https://darksigns.pf-control.de/forum)
+-- Forum: DarkSignsJ (https://darksigns.pf-control.de/forum/forumdisplay.php?fid=3)
+--- Forum: Dark Script (https://darksigns.pf-control.de/forum/forumdisplay.php?fid=6)
+--- Thread: Utility Scripts (/showthread.php?tid=300)



Utility Scripts - flederohr - 03-17-2020

Here is a File loader with spinner and progress bar that can be integrated in other scripts
Code:
var count, currentIndex, percent, a0, a1,a2,a3,dots, wait

varexists ext1
if varexists
   !wait=ext1
else
   !wait=10
endif

!percent=0
!count=0
!a0=|
!a1=/
!a2=~
!a3=\\
!dots=

while percent<100 do

   !currentIndex=count mod 4
   ? File Loading %dots%%a%currentIndex%% [%percent%%]
   wait 30

   !count=count+1
   rndint %wait%
   if rndint < 5
       !percent=percent+1
       if percent mod 5=0
           !dots=%dots%.
       endif
   endif
done
? File Loading %dots%. [%percent%%]

free count, currentIndex, percent, a0,a1,a2,a3,dots, wait, varexists, rndint



RE: Utility Scripts - flederohr - 03-17-2020

A visualization of the random generator
safe as file random

compile thee script
Code:
compile random
 
and run with arguments [range of numbers] [number of random generations]

Code:
random 20 1000
 
Code:
var i,j,len,c,out

varexists ext1
!len=10
if varexists
    !len=ext1
endif

varexists ext2
!c=100
if varexists
    !c=ext2
endif

!i=0
while i<len do
    var rand_%i%
    !rand_%i%=
    !i=i+1
done

!j=0
while j<c do
//      clear
    rndint %len%
    !rand_%rndint%=%rand_%rndint%%#
    !i=0
    !out=####################\n
    while i<len do
        !out=%out%%i%:\t%rand_%i%%\n
        !i=i+1
    done
    !out=%out%####################
    ? %out%
    wait 10
    !j=j+1
done

!c=0
!i=0
while i<len do
    strlen rand_%i%
    !c=c+strlen
    free rand_%i%
    !i=i+1
done
say 0 sum: %c%

free i,j,len,c,out,strlen



- - VanessaHic - 07-07-2021

It is remarkable, rather the helpful information


- - MyCreditDom - 01-04-2022

I apologise, but, in my opinion, you are mistaken. I can defend the position. Write to me in PM.


- - AugustDiumb - 01-09-2022

Darin die ganze Sache.


- - AudreyCib - 01-18-2022

Ist einverstanden, die sehr lustige Meinung