PDA

View Full Version : Need help setting up a gag


alberonn
04-14-2006, 08:15 PM
I am borrowing a friend's AmigaOne and I want to setup a prank.

I have discovered that the AmigaOne's themes are setup by copying all of the prefs files to ENV: . I believe that the "Save Theme" Icon just copies them to ENVARC: . I want to create a joke theme for him. (It would still*leave his system usable, it's just the backdrop, ect. would be a bit "shocking" for him. )

I know I can bury the command to launch the script or whatever in his Startup-Sequence. What I need is some way to setup a "delay" on when it copies the files over. Like after every 10 reboots or so.

What would the best way to do this be???

Matt_H
04-14-2006, 09:59 PM
You might be able to set up a script that replaces ENV:sys/wbpattern.prefs depending on a variable. (Something you'll need to dump in ENVARC:) Augment the value by 1 each boot, and if it's divisible by 10, change the prefs. (Mod operator = 0)

Better hope your friend doesn't read Amiga forums!

Amigadude
04-15-2006, 07:19 AM
to do it in arexx copy & paste this into a text editor, save as s:tenthboot then do this from a shell prompt "protect s:tenthboot +s"

/* $VER: V0.001 change on tenth boot */


/* copy normal WBPattern.prefs with:
copy envarc:sys/WBPattern.prefs envarc:sys/WBPattern-norm.prefs
edit wbpattern using the prefs editor, save then copy that with:
copy envarc:sys/WBPattern.prefs envarc:sys/WBPattern-tenth.prefs
copy the original back with:
copy envarc:sys/WBPattern-norm.prefs envarc:sys/WBPattern.prefs */


IF Open('inputfile', 'rexx:tenthboot.count', 'R') then do
bootcount = ReadLN('inputfile')
call close('inputfile')
end
else do
bootcount = 0
end

bootcount = bootcount + 1

select
when (bootcount = 10) then
ADDRESS COMMAND "copy >nil: env:sys/WBPattern-tenth.prefs env:sys/WBPattern.prefs"
when (bootcount = 11) then do
ADDRESS COMMAND "copy >nil: env:sys/WBPattern-norm.prefs env:sys/WBPattern.prefs"
bootcount = 1
end
otherwise
end

IF Open('outputfile', 'rexx:tenthboot.count', 'W') then do
call WriteLN('outputfile', bootcount)
call close('outputfile')
end


below the line "C:Copy >NIL: ENVARC: RAM:ENV ALL NOREQ" add these two lines:


SYS:System/RexxMast >NIL:
s:tenthboot


then remove the other "SYS:System/RexxMast >NIL:" from s:startup-sequence or user-startup...

should work, any problems you can get in touch with me on the #amiga.org channel on zirc

JohnN (AKA AD-Laptop, Amigadude)

blobrana
04-15-2006, 09:32 AM
Hum,
reminds me of the morbidly obese computer geek who sabotaged the computer system in Jurassic Park.

“Ah ah ah, you didn't say the magic word” (http://www.audiosparx.com/sa/temp/10835.asf)

alberonn
04-15-2006, 03:31 PM
The line you mentioned in the S-S (C:Copy >NIL: ENVARC: RAM:ENV ALL NOREQ) doesn't seem to exist in OS4.

This is what I got:

-8<-------

; $VER: Startup-Sequence 51.2 (28.05.2005)

C:SetPatch QUIET

FailAt 21

C:Version >NIL:
SetEnv Workbench $Workbench
SetEnv Kickstart $Kickstart
UnSet Workbench
UnSet Kickstart

C:MakeDir RAM:T RAM:Clipboards

C:Assign >NIL: T: RAM:T
C:Assign >NIL: CLIPS: RAM:Clipboards
C:Assign >NIL: REXX: S:Arexx
C:Assign >NIL: LOCALE: SYS:Locale DEFER
C:Assign >NIL: CLASSES: SYS:classes DEFER
C:Assign >NIL: PRINTERS: DEVS:Printers
C:Assign >NIL: KEYMAPS: DEVS:Keymaps
C:Assign >NIL: LIBS: SYS:Classes add
C:Assign >NIL: HELP: LOCALE:Help DEFER

C:Mount >NIL: DEVS:DOSDrivers/~(#?.(info|off))
C:AddNetInterface >NIL: DEVS:NetInterfaces/~(#?.(info|off))
C:LoadMonDrvs
C:AddDataTypes REFRESH QUIET
C:IPrefs
C:ConClip

Path RAM: S:Shell S:Arexx SYS:Utilities SYS:Tools SYS:Tools/Commodities SYS:System SYS:Prefs SYS:WBStartup

SYS:System/REXXMast >NIL:
C:USBCtrl >NIL: start

IF EXISTS SYS:Utilities/GhostScript
C:Assign >NIL: ghostscript: SYS:Utilities/GhostScript
EndIF

IF EXISTS S:User-Startup
Execute S:User-Startup
EndIF

;BEGIN PowerIcons
Run >NIL: PowerIcons >NIL:
;END PowerIcons

C:LoadWB
EndCLI >NIL:
-8<-------

The only change I've made was adding the Power Icons lines.

alberonn
04-17-2006, 07:26 PM
OK I set it up as directed. However, I just stuck the "S:tenthboot" command right after the existing REXXMast command. It works beautifully.

One thing I really like it the fact that it sets it to the normal pattern after the tenth boot.