Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] I mean do you think I can improve the hole code more?

[DiscordArchive] I mean do you think I can improve the hole code more?

[DiscordArchive] I mean do you think I can improve the hole code more?

rektbyfaith
Administrator
0
05-22-2022, 07:38 AM
#1
Archived author: Tanados • Posted: 2022-05-22T07:38:17.069000+00:00
Original source

I mean do you think I can improve the hole code more?
rektbyfaith
05-22-2022, 07:38 AM #1

Archived author: Tanados • Posted: 2022-05-22T07:38:17.069000+00:00
Original source

I mean do you think I can improve the hole code more?

rektbyfaith
Administrator
0
05-22-2022, 03:58 PM
#2
Archived author: Revision • Posted: 2022-05-22T15:58:18.283000+00:00
Original source

Try creating a bash script with the following code
```
#!/bin/bash
[ -z $1 ] && time=300 || time=$1
[ $time -gt 60 ] && timetext="$((time / 60)) minutes" || timetext="1 minute"

echo "Time: $time"
echo "Timetext: $timetext"
```

If you run `./script.sh` (or whatever you name it), it'll default to 300 seconds, if you run `./script.sh 900` for example it'll use 900 seconds instead. That was my point, to make it easier to change the time. The echos are there to show what it does.
rektbyfaith
05-22-2022, 03:58 PM #2

Archived author: Revision • Posted: 2022-05-22T15:58:18.283000+00:00
Original source

Try creating a bash script with the following code
```
#!/bin/bash
[ -z $1 ] && time=300 || time=$1
[ $time -gt 60 ] && timetext="$((time / 60)) minutes" || timetext="1 minute"

echo "Time: $time"
echo "Timetext: $timetext"
```

If you run `./script.sh` (or whatever you name it), it'll default to 300 seconds, if you run `./script.sh 900` for example it'll use 900 seconds instead. That was my point, to make it easier to change the time. The echos are there to show what it does.

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)